Hi Usernamevisible,Your count is almost right - the only thing tripping you up is what the phrase "other than 1" is actually doing.
Read the condition carefullyThe rule isn't "exclude the number 1." It is: the integer you are counting must share no factor with p
except 1. In other words, the only factor it is allowed to have in common with p is 1 itself.
So when you test the number
1 against
7:
- The factors of
1 are just {1}.
- The only factor 1 shares with 7 is
1.
- That is exactly what the condition allows, so
1 qualifies and gets counted.
The phrase "other than 1" describes the
permitted common factor, not a number to throw out. Every integer from
1 to
6 shares only the factor 1 with 7 (since 7 is prime), so all six count:
1, 2, 3, 4, 5, 6 gives f(7) =
6 = 7 - 1.
That is why the answer is p - 1, not p - 2. You would only get p - 2 if 1 really had to be dropped, but it does not.
Quick check to lock it inTry f(5). The numbers less than 5 are 1, 2, 3, 4. Does 1 share any factor with 5 besides 1? No. So all four count, giving f(5) =
4 = 5 - 1. Same pattern for every prime.
Answer: AUsernamevisible
Bunuel - why should 1 be counted in this solution for taking f(7) ?
I am confused and marked p-2