functionprime235Factorization

Factorization of an integer in prime numbers 2,3,5

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

(success, e2, e3, e5) = prime235Factorization(n);

Description

Compute the factorization of input Integer n in prime numbers 2, 3, and 5. If this is possible, success = true and e2 is the number of prime numbers2, e3 the number of prime numbers 3 and e5 the number of prime numbers 5. If this is not possible, success = false, and e2, e3, e5 are dummy values.

Example

(success, e2, e3, e5) = prime235Factorization(60)   // success=true, e2=2, e3=1, e5=1 (= 2^2*3^1*5^1)
(success, e2, e3, e5) = prime235Factorization(7)    // success=false

Inputs

TypeNameDefaultDescription
Integern

Outputs

TypeNameDefaultDescription
Booleansuccess= true, if factorization in 2,3,5 is possible
Integere2n = 2^e2*3^e3*5^e5
Integere3n = 2^e2*3^e3*5^e5
Integere5n = 2^e2*3^e3*5^e5

Revisions

Date Description
Nov. 29, 2015 Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control.