Decomposes a positive integer into its constituent prime powers (I. Wakeling & R.W. Payne).
|Controls printed output (
||Number to be decomposed|
||Prime factors of
||Powers of the prime factors in
PRIMEPOWER decomposes the integer specified by the
NUMBER parameter into its constituent prime powers. The results can be saved using the
POWERS parameters. These return pointers to a set of scalars storing, respectively, the relevant prime numbers and their powers. If
NUMBER is not a positive integer, the pointers will each contain a single scalar containing a missing value. The decomposition can also be printed by setting option
PRIMEPOWER uses the standard Genstat calculation directives.
Commands for: Calculations and manipulation.
CAPTION 'PRIMEPOWER example'; STYLE=meta " a single prime " PRIMEPOWER [PRINT=decomposition] 17; PRIMES=p; POWERS=n " powers of a single prime " PRIMEPOWER [PRINT=decomposition] 8; PRIMES=p; POWERS=n " powers of several primes " PRIMEPOWER [PRINT=decomposition] 12; PRIMES=p; POWERS=n PRINT p,n; DECIMALS=0