File tree 1 file changed +4
-3
lines changed
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
2
3
public 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;
4
5
public static int getEuler (int n ) {
5
6
int result = n ;
6
7
for (int i = 2 ; i * i <= n ; i ++) {
@@ -13,7 +14,7 @@ public static int getEuler(int n) {
13
14
return result ;
14
15
}
15
16
public static void main (String [] args ) {
16
- for (int i = 1 ; i < 100 ; i ++) {
17
+ for (int i = 1 ; i < 100 ; i ++) {
17
18
System .out .println (getEuler (i ));
18
19
}
19
20
}
You can’t perform that action at this time.
0 commit comments