Skip to content

Commit 12215a1

Browse files
authored
Update EulersFunction.java
1 parent 6351bf2 commit 12215a1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Others/EulersFunction.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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
23
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;
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
}

0 commit comments

Comments
 (0)