Question
Question: Let $f(x) = x^2 - 45x + 2$. Find number of integers $n \ge 2$ such that exactly one of the number $...
Let f(x)=x2−45x+2.
Find number of integers n≥2 such that exactly one of the number f(1),f(2),....f(n) is divisible by n.

1
2
3
4
2
Solution
We are looking for the number of integers n≥2 such that there is a unique k∈{1,2,…,n} for which f(k)≡0(modn). The condition is k2−45k+2≡0(modn).
First, consider the case when n is even. Let n=2m. f(x)=x2−45x+2≡x2−x(mod2). Since x2−x=x(x−1) is always even, f(x) is always divisible by 2 for any integer x. If n is even, then f(x)≡0(mod2) for all x. If there exists a k such that f(k)≡0(modn), then f(k) is divisible by n. Since n is even, f(k) is divisible by 2, which is always true. However, we need exactly one such k. For n=2, f(1)=1−45+2=−42≡0(mod2) and f(2)=4−90+2=−84≡0(mod2). Both are divisible by 2, so n=2 is not a solution. For any even n, f(x) is always even. It is difficult to ensure that f(k)≡0(modn) for exactly one k. This suggests n must be odd.
Now, let n be an odd integer, n≥3. We can complete the square for k2−45k+2≡0(modn). Multiplying by 4 (since n is odd, gcd(4,n)=1), we get: 4k2−180k+8≡0(modn) (2k)2−2(2k)(45)+452−452+8≡0(modn) (2k−45)2≡452−8(modn) (2k−45)2≡2025−8(modn) (2k−45)2≡2017(modn).
Let y=2k−45. As k ranges over {1,2,…,n}, y also ranges over all n distinct residues modulo n because n is odd. So, the problem is equivalent to finding the number of odd n≥3 such that the congruence y2≡2017(modn) has exactly one solution for y∈{0,1,…,n−1}.
Let N(a,n) be the number of solutions to y2≡a(modn). We need N(2017,n)=1. Let the prime factorization of n be n=p1a1⋯prar. Then N(2017,n)=N(2017,p1a1)⋯N(2017,prar). For N(2017,n)=1, we need N(2017,piai)=1 for all i.
Consider the congruence y2≡a(modpk) where p is an odd prime.
- If p∤a: N(a,pk)=2 if (a/p)=1, and N(a,pk)=0 if (a/p)=−1.
- If p∣a: Let a=psb with p∤b.
- If s≥k: a≡0(modpk). y2≡0(modpk).
- For k=1, y2≡0(modp) has exactly one solution y≡0(modp). So N(0,p)=1.
- For k≥2, y2≡0(modpk) has two solutions: y≡0(modp⌈k/2⌉). These are y=0 and y=p⌈k/2⌉ modulo pk. So N(0,pk)=2 for k≥2.
- If s<k: y2≡psb(modpk).
- If s is odd, there are no solutions.
- If s is even, s=2m. Then y2≡p2mb(modpk). This implies pm∣y. Let y=pmz. p2mz2≡p2mb(modpk)⟹z2≡b(modpk−2m). Since p∤b, this congruence has 2 solutions if (b/p)=1 and 0 solutions if (b/p)=−1. This requires k−2m≥1.
- If s≥k: a≡0(modpk). y2≡0(modpk).
Therefore, for N(a,pk)=1, we must have k=1 and p∣a (i.e., s≥1).
Now, we need to determine if 2017 is prime. Checking divisibility by primes up to 2017≈45, we find that 2017 is prime. So, for N(2017,n)=1, where n=p1a1⋯prar, we must have N(2017,piai)=1 for each i. This implies that for each prime factor pi of n, we must have ai=1 and pi∣2017. Since 2017 is prime, the only prime factor is 2017 itself. Thus, n must be of the form 20171. So n=2017 is a possible solution. Let's check n=2017. y2≡2017(mod2017)⟹y2≡0(mod2017). Since 2017 is prime, this has a unique solution y≡0(mod2017). So n=2017 is a solution.
Now consider the case where n is even. We already showed that n cannot be divisible by 4 or higher powers of 2. So, if n is even, it must be n=2m, where m is odd. N(2017,n)=N(2017,2)⋅N(2017,m). We need N(2017,2)=1 and N(2017,m)=1. For n=2, y2≡2017≡1(mod2). The solution is y≡1(mod2). So N(2017,2)=1. For m to satisfy N(2017,m)=1, m must be odd. As shown above, the only odd solution for m is m=2017. So, n=2×2017=4034 is another potential solution. Let's check n=4034. We need y2≡2017(mod4034). This is equivalent to the system:
- y2≡2017(mod2)⟹y2≡1(mod2)⟹y≡1(mod2).
- y2≡2017(mod2017)⟹y2≡0(mod2017)⟹y≡0(mod2017). By the Chinese Remainder Theorem, there is a unique solution modulo 2×2017=4034. y=2017k. Substituting into the first congruence: 2017k≡1(mod2)⟹k≡1(mod2). So k=1, which gives y=2017. Thus, n=4034 is a solution.
The possible values for n are 2017 and 4034. There are 2 such integers.