src/com/michaelho/RandomizedAlgorithms/RA2.java
/**
         * Euler Totient Function, count all number under n and is a co-prime number of n.
         * For example, phi(5) = 4 since 1, 2, 3, 4 are the 4 numbers that are co-prime of 5 and are under 5.
         * Reference: https://www.geeksforgeeks.org/eulers-totient-function-for-all-numbers-smaller-than-or-equal-to-n/
         *
         * @param n The n is the above description.
         * @return the phi function result.
         * */
Euler Totient Function, count all number under n and is a co-prime number of n.
For example, phi(5) = 4 since 1, 2, 3, 4 are the 4 numbers that are co-prime of 5 and are under 5.

@param n The n is the above description.
@return the phi function result.
Euler Totient Function count all number under n and is a co - prime number of n . For example phi ( 5 ) = 4 since 1 2 3 4 are the 4 numbers that are co - prime of 5 and are under 5 . @param n The n is the above description . @return the phi function result .
int phi(int n) {
            int result = 1;
            RA1 ra1 = new RA1();
            for (int i = 2; i < n; i++)
                if (ra1.gcd.euclidAlgorithm(i, n) == 1)
                    result++;
            return result;
        }
int phi ( int n ) { int result = 1 ; RA1 ra1 = new RA1 ( ) ; for ( int i = 2 ; i < n ; i ++ ) if ( ra1 . gcd . euclidAlgorithm ( i , n ) == 1 ) result ++ ; return result ; }
Euler Totient Function, count all number under n and is a co-prime number of n.
 For example, phi(5) = 4 since 1, 2, 3, 4 are the 4 numbers that are co-prime of 5 and are under 5.
Euler Totient Function count all number under n and is a co - prime number of n . For example phi ( 5 ) = 4 since 1 2 3 4 are the 4 numbers that are co - prime of 5 and are under 5 .