Anthony Stone's root-rational-fraction program package

Home -> Programs -> RRF -> Subroutines and functions -> power-of-prime notation


Personal information

Computer programs

Research details

The Theory of Intermolecular Forces


Supplementary material for published papers

Power of Prime input and output

Numbers to be read in power-of-prime form must be written as

sign x(1) x(2) ... x(NP) [prime[^exp]] ... [[.] n![^exp]] ...

The sign factor must be present (even for positive numbers). It is followed by exponents for the first NP primes; NP is specified as an argument to the PP_TO_RRF routine, and may be zero. The remaining elements of this expression are optional, as indicated by the square brackets (which should not themselves appear). Each element represents a factor in the required number; that is, the elements are multiplied together to arrive at the result. Numbers output in power-of-prime form appear in the same format. Examples are given below.

is either 0 (denoting a zero value) or +, (+)1, (+)i, -(1), or -i (the sign term of a positive number may not be omitted).
represents a factor comprising the specified prime number prime raised to the power exp. E.g. 5^2 represents the factor 25. The exponent may be omitted if it is 1.
is read as n factorial raised to the exponent given. The exponent may be omitted if it is 1.

Prime and factorial terms may occur in any order and may be interspersed with each other. Neither may contain embedded blanks, but they are separated by blanks or period, `.'.The ^ introducing an exponent may be omitted if the first character of the exponent is + or -. Exponents have the form [-]nnn..[/2].

Examples: Uisng NP=0, the line

+ 2^-1/2 . 3^1/2 . 5+1/2 . 7-1/2 . 4!

would be read as 24 sqrt(15/14). Using NP=4 the same number could be input as

+ -1/2 1/2 1/2 -1/2 4!

or as

+ 5/2 3/2 1/2 -1/2

Valid HTML 4.01 Transitional