File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1- //You can read more about Euler's totient function https://en.wikipedia.org/wiki/Euler%27s_totient_function
1+ // You can read more about Euler's totient function
2+ // https://en.wikipedia.org/wiki/Euler%27s_totient_function
23public class EulersFunction {
3- //This method returns us number of x that (x < n) and gcd(x, n) == 1 in O(sqrt(n)) time complexity;
4+ // This method returns us number of x that (x < n) and gcd(x, n) == 1 in O(sqrt(n)) time complexity;
45 public static int getEuler (int n ) {
56 int result = n ;
67 for (int i = 2 ; i * i <= n ; i ++) {
@@ -13,7 +14,7 @@ public static int getEuler(int n) {
1314 return result ;
1415 }
1516 public static void main (String [] args ) {
16- for (int i = 1 ; i < 100 ; i ++) {
17+ for (int i = 1 ; i < 100 ; i ++) {
1718 System .out .println (getEuler (i ));
1819 }
1920 }
You can’t perform that action at this time.
0 commit comments