PHI by Joseph K. Horn -- A Number Theory tool. Calculates PHI(x), Euler's totient function. +-------------------------------------------------------------------------+ | NOTE: This program calls FACTOR, a program by Jurjen NE Bos, available | | on EduCALC Goodies Disk #2. You must be in the FACTOR directory when | | you upload ALLF, or it will not work. | +-------------------------------------------------------------------------+ PHI(x) is defined as the number of integers between 1 and x that are relatively prime to x (i.e. share no prime factors with x). For example, since 15 is relatively prime to 1, 2, 4, 7, 8, 11, 13 and 14 (8 numbers), PHI(15) is 8. By convention, 1 is neither a prime nor a composite, and is therefore considered relatively prime to everything. Thus PHI(1)=1. PHI of anything less than 1 yields 0. The number of primitive roots of x is exactly equal to PHI(PHI(x)). For example, to see that 351 has 72 primitive roots, type 351 and press PHI twice. This means that there are 72 numbers between 1 and 351 which are relatively prime to 351. Anything that can be described in terms of close-range random but long-range patterns can be modeled by primitive root cycles. The applications of this range from the SpiroGraph child's toy to the mathematics of Chaos Theory. -Joseph K. Horn- -Peripheral Vision, Ltd.-