[Math] Why is 2 totative of 36

elementary-number-theorytotient-function

Based on my understanding, the totient of any number K is the number of relative primes to K, i.e. numbers less than or equal to K that do not share a divisor.

Everywhere I look is telling me that 2 is inclusive in the set of totatives of 36, but it doesn't seem to be the case for other even numbers.

Thanks.

Edit

Thanks for the responses. I suppose I am confused because I can't figure out the 12th totient from 1 to 36 inclusive.

Prime numbers from 0 to 36 include 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31

Querying wolfram alpha or a number of other sites yields the result that 36 has a totient of 12, the same number of primes I listed above — but again, 2 should not be included in this count. I must be missing something (i.e. another relative prime) to have found a totient of only 11 in my verification. What am I missing?

Best Answer

You're confusing prime with relatively prime.

Thanks for the responses. I suppose I am confused because I can't figure out the 12th totient from 1 to 36 inclusive.

Prime numbers from 0 to 36 include 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31

You don't pretend that 1 is prime in this context, you recognize that gcd(1,36) = 1 and so 1 is relatively prime to 36. So the relevant list isn't the one you give, it's

sage: [k for k in [1..36] if gcd(k,36) == 1]
[1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35]
sage: len([k for k in [1..36] if gcd(k,36) == 1])
12

Does that make sense?

Related Question