PRIMEPOWER procedure

Decomposes a positive integer into its constituent prime powers (I. Wakeling & R.W. Payne).


Option

PRINT = string
Controls printed output (decomposition); default *


Parameters

NUMBER = scalars
Number to be decomposed

PRIMES = pointers
Prime factors of NUMBER

POWERS = pointers
Powers of the prime factors in NUMBER


Description

Procedure PRIMEPOWER decomposes the integer specified by the NUMBER parameter into its constituent prime powers. The results can be saved using the PRIMES and 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 PRINT=decomposition.


Option: PRINT.

Parameters: NUMBER, PRIMES, POWERS.


Method

PRIMEPOWER uses the standard GenStat calculation directives.