answersLogoWhite

0

Implement this method:

public static int totient(int n) {

int count = 0;

for(int i = 1; i < n; i++)

if(gcd(n,i) == 1)

count++;

return count;

}

You can implement your own gcd(int a, int b) method, or find one of the many online.

User Avatar

Wiki User

15y ago

What else can I help you with?