On the other hand, in this post I outlined a simple algorithm for finding the order of 2 mod n when n is the product of two distinct odd primes.

This simple algorithm is crucial in finding φ(n) because the order of 2 mod n is the smallest integer k such that

2

^{k}= 1 mod nFurthermore, since k divides φ(n) then the following brand new algorithm can get to phi of n without modulus, and without exponentiation simply by generating the row at 2 up to k as described and cycling through that row until n is reached as follows: