Solveeit Logo

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)=x245x+2f(x) = x^2 - 45x + 2.

Find number of integers n2n \ge 2 such that exactly one of the number f(1),f(2),....f(n)f(1), f(2),....f(n) is divisible by nn.

A

1

B

2

C

3

D

4

Answer

2

Explanation

Solution

We are looking for the number of integers n2n \ge 2 such that there is a unique k{1,2,,n}k \in \{1, 2, \dots, n\} for which f(k)0(modn)f(k) \equiv 0 \pmod{n}. The condition is k245k+20(modn)k^2 - 45k + 2 \equiv 0 \pmod{n}.

First, consider the case when nn is even. Let n=2mn=2m. f(x)=x245x+2x2x(mod2)f(x) = x^2 - 45x + 2 \equiv x^2 - x \pmod{2}. Since x2x=x(x1)x^2 - x = x(x-1) is always even, f(x)f(x) is always divisible by 2 for any integer xx. If nn is even, then f(x)0(mod2)f(x) \equiv 0 \pmod{2} for all xx. If there exists a kk such that f(k)0(modn)f(k) \equiv 0 \pmod{n}, then f(k)f(k) is divisible by nn. Since nn is even, f(k)f(k) is divisible by 2, which is always true. However, we need exactly one such kk. For n=2n=2, f(1)=145+2=420(mod2)f(1) = 1 - 45 + 2 = -42 \equiv 0 \pmod{2} and f(2)=490+2=840(mod2)f(2) = 4 - 90 + 2 = -84 \equiv 0 \pmod{2}. Both are divisible by 2, so n=2n=2 is not a solution. For any even nn, f(x)f(x) is always even. It is difficult to ensure that f(k)0(modn)f(k) \equiv 0 \pmod{n} for exactly one kk. This suggests nn must be odd.

Now, let nn be an odd integer, n3n \ge 3. We can complete the square for k245k+20(modn)k^2 - 45k + 2 \equiv 0 \pmod{n}. Multiplying by 4 (since nn is odd, gcd(4,n)=1\gcd(4, n)=1), we get: 4k2180k+80(modn)4k^2 - 180k + 8 \equiv 0 \pmod{n} (2k)22(2k)(45)+452452+80(modn)(2k)^2 - 2(2k)(45) + 45^2 - 45^2 + 8 \equiv 0 \pmod{n} (2k45)24528(modn)(2k - 45)^2 \equiv 45^2 - 8 \pmod{n} (2k45)220258(modn)(2k - 45)^2 \equiv 2025 - 8 \pmod{n} (2k45)22017(modn)(2k - 45)^2 \equiv 2017 \pmod{n}.

Let y=2k45y = 2k - 45. As kk ranges over {1,2,,n}\{1, 2, \dots, n\}, yy also ranges over all nn distinct residues modulo nn because nn is odd. So, the problem is equivalent to finding the number of odd n3n \ge 3 such that the congruence y22017(modn)y^2 \equiv 2017 \pmod{n} has exactly one solution for y{0,1,,n1}y \in \{0, 1, \dots, n-1\}.

Let N(a,n)N(a, n) be the number of solutions to y2a(modn)y^2 \equiv a \pmod{n}. We need N(2017,n)=1N(2017, n) = 1. Let the prime factorization of nn be n=p1a1prarn = p_1^{a_1} \cdots p_r^{a_r}. Then N(2017,n)=N(2017,p1a1)N(2017,prar)N(2017, n) = N(2017, p_1^{a_1}) \cdots N(2017, p_r^{a_r}). For N(2017,n)=1N(2017, n) = 1, we need N(2017,piai)=1N(2017, p_i^{a_i}) = 1 for all ii.

Consider the congruence y2a(modpk)y^2 \equiv a \pmod{p^k} where pp is an odd prime.

  • If pap \nmid a: N(a,pk)=2N(a, p^k) = 2 if (a/p)=1(a/p)=1, and N(a,pk)=0N(a, p^k) = 0 if (a/p)=1(a/p)=-1.
  • If pap | a: Let a=psba = p^s b with pbp \nmid b.
    • If sks \ge k: a0(modpk)a \equiv 0 \pmod{p^k}. y20(modpk)y^2 \equiv 0 \pmod{p^k}.
      • For k=1k=1, y20(modp)y^2 \equiv 0 \pmod p has exactly one solution y0(modp)y \equiv 0 \pmod p. So N(0,p)=1N(0, p)=1.
      • For k2k \ge 2, y20(modpk)y^2 \equiv 0 \pmod{p^k} has two solutions: y0(modpk/2)y \equiv 0 \pmod{p^{\lceil k/2 \rceil}}. These are y=0y=0 and y=pk/2y=p^{\lceil k/2 \rceil} modulo pkp^k. So N(0,pk)=2N(0, p^k)=2 for k2k \ge 2.
    • If s<ks < k: y2psb(modpk)y^2 \equiv p^s b \pmod{p^k}.
      • If ss is odd, there are no solutions.
      • If ss is even, s=2ms=2m. Then y2p2mb(modpk)y^2 \equiv p^{2m} b \pmod{p^k}. This implies pmyp^m | y. Let y=pmzy=p^m z. p2mz2p2mb(modpk)    z2b(modpk2m)p^{2m} z^2 \equiv p^{2m} b \pmod{p^k} \implies z^2 \equiv b \pmod{p^{k-2m}}. Since pbp \nmid b, this congruence has 2 solutions if (b/p)=1(b/p)=1 and 0 solutions if (b/p)=1(b/p)=-1. This requires k2m1k-2m \ge 1.

Therefore, for N(a,pk)=1N(a, p^k)=1, we must have k=1k=1 and pap|a (i.e., s1s \ge 1).

Now, we need to determine if 2017 is prime. Checking divisibility by primes up to 201745\sqrt{2017} \approx 45, we find that 2017 is prime. So, for N(2017,n)=1N(2017, n)=1, where n=p1a1prarn=p_1^{a_1} \cdots p_r^{a_r}, we must have N(2017,piai)=1N(2017, p_i^{a_i})=1 for each ii. This implies that for each prime factor pip_i of nn, we must have ai=1a_i=1 and pi2017p_i | 2017. Since 2017 is prime, the only prime factor is 2017 itself. Thus, nn must be of the form 201712017^1. So n=2017n=2017 is a possible solution. Let's check n=2017n=2017. y22017(mod2017)    y20(mod2017)y^2 \equiv 2017 \pmod{2017} \implies y^2 \equiv 0 \pmod{2017}. Since 2017 is prime, this has a unique solution y0(mod2017)y \equiv 0 \pmod{2017}. So n=2017n=2017 is a solution.

Now consider the case where nn is even. We already showed that nn cannot be divisible by 4 or higher powers of 2. So, if nn is even, it must be n=2mn=2m, where mm is odd. N(2017,n)=N(2017,2)N(2017,m)N(2017, n) = N(2017, 2) \cdot N(2017, m). We need N(2017,2)=1N(2017, 2)=1 and N(2017,m)=1N(2017, m)=1. For n=2n=2, y220171(mod2)y^2 \equiv 2017 \equiv 1 \pmod 2. The solution is y1(mod2)y \equiv 1 \pmod 2. So N(2017,2)=1N(2017, 2)=1. For mm to satisfy N(2017,m)=1N(2017, m)=1, mm must be odd. As shown above, the only odd solution for mm is m=2017m=2017. So, n=2×2017=4034n = 2 \times 2017 = 4034 is another potential solution. Let's check n=4034n=4034. We need y22017(mod4034)y^2 \equiv 2017 \pmod{4034}. This is equivalent to the system:

  1. y22017(mod2)    y21(mod2)    y1(mod2)y^2 \equiv 2017 \pmod{2} \implies y^2 \equiv 1 \pmod{2} \implies y \equiv 1 \pmod{2}.
  2. y22017(mod2017)    y20(mod2017)    y0(mod2017)y^2 \equiv 2017 \pmod{2017} \implies y^2 \equiv 0 \pmod{2017} \implies y \equiv 0 \pmod{2017}. By the Chinese Remainder Theorem, there is a unique solution modulo 2×2017=40342 \times 2017 = 4034. y=2017ky = 2017k. Substituting into the first congruence: 2017k1(mod2)    k1(mod2)2017k \equiv 1 \pmod{2} \implies k \equiv 1 \pmod{2}. So k=1k=1, which gives y=2017y = 2017. Thus, n=4034n=4034 is a solution.

The possible values for nn are 20172017 and 40344034. There are 2 such integers.