Skip to content
Lanchai's Blog Life is a random walk.
Go back

Elementary Number Theory — Reference Exercises

Edit page

This post collects 30 elementary number theory exercises, covering congruences, quadratic residues, primitive roots, Diophantine equations, cyclotomic polynomials, Dirichlet density, and more.


Problem 1. Let pp be an odd prime. For each integer 1ip11 \le i \le p-1, let aia_i be a positive integer satisfying iai1(modp)i a_i \equiv 1 \pmod{p}.

  1. Prove that i=1p1ai0(modp)\displaystyle\sum_{i=1}^{p-1} a_i \equiv 0 \pmod{p}.
  2. Let SS be the sum of the first p1p-1 positive integers: S=1+2++(p1)S = 1 + 2 + \cdots + (p-1). Prove that for all primes p>3p > 3, (p1)!≢1(modS)(p-1)! \not\equiv -1 \pmod{S}.

Problem 2. Let pp and qq be odd primes. Suppose qq divides the Mersenne number Mp=2p1M_p = 2^p - 1. Prove that q>pq > p.


Problem 3. Consider the quadratic congruence x2a(modp2)x^2 \equiv a \pmod{p^2}, where pp is an odd prime and gcd(a,p)=1\gcd(a, p) = 1.

  1. Let x0x_0 be a solution to x2a(modp)x^2 \equiv a \pmod{p}. Prove that there exists a unique integer tt modulo pp such that x1=x0+tpx_1 = x_0 + tp is a solution to the congruence modulo p2p^2.
  2. Prove that for every positive integer kk, the equation x2a(modpk)x^2 \equiv a \pmod{p^k} has a solution.

Problem 4. Consider the Diophantine equation x3+2y3=7z3x^3 + 2y^3 = 7z^3.

  1. Prove that the cube of any integer is congruent to 0,10, 1, or 1-1 modulo 77.
  2. Prove that x3+2y3=7z3x^3 + 2y^3 = 7z^3 has only the trivial solution x=y=z=0x = y = z = 0.

Problem 5. Consider the equation x23y2=1x^2 - 3y^2 = 1.

  1. Find the smallest positive integer solution (x1,y1)(x_1, y_1).
  2. Define the sequence of solutions by (xn+yn3)=(x1+y13)n(x_n + y_n\sqrt{3}) = (x_1 + y_1\sqrt{3})^n. Prove that xnx_n is always odd.
  3. Prove that {(xn,yn)nZ>0}\{(x_n, y_n) \mid n \in \mathbb{Z}_{>0}\} is the set of all positive integer solutions.

Problem 6. Let μ(n)\mu(n) denote the Möbius function, and let Φn(x)\Phi_n(x) denote the nn-th cyclotomic polynomial. We have xn1=dnΦd(x)x^n - 1 = \prod_{d \mid n} \Phi_d(x).

  1. Express Φn(x)\Phi_n(x) as a rational function of terms of the form xd1x^d - 1.
  2. Let pp be a prime. Prove that Φpk(x)=Φp(xpk1)\Phi_{p^k}(x) = \Phi_p(x^{p^{k-1}}).

Problem 7. Find the remainder of 7777^{7^7} upon division by 100100.


Problem 8. Let aZa \in \mathbb{Z} be coprime to 1010. Prove that a201(mod100)a^{20} \equiv 1 \pmod{100}.


Problem 9. Let p>3p > 3 be a prime. Suppose there exists an integer aa whose multiplicative order modulo pp is 33.

  1. Prove that p1(mod3)p \equiv 1 \pmod{3}.
  2. Prove that a2+a+10(modp)a^2 + a + 1 \equiv 0 \pmod{p}.
  3. Determine the multiplicative order of a+1a + 1 modulo pp, and prove your answer.

Problem 10. Let pp be an odd prime with p2026p \nmid 2026. Determine the condition on pp for the congruence x22026(modp)x^2 \equiv 2026 \pmod{p} to have a solution.


Problem 11. Solve the Diophantine equation x2+y2+z2=615x^2 + y^2 + z^2 = 615.


Problem 12.

  1. Prove that for any prime pp and positive integer kk, the equation x2x(modpk)x^2 \equiv x \pmod{p^k} has exactly two solutions, and write them down.
  2. Find all solutions to x2x(mod100)x^2 \equiv x \pmod{100}.

Problem 13. Let pp be an odd prime.

  1. Prove that for all integers 0kp10 \le k \le p-1, the binomial coefficient satisfies (p1k)(1)k(modp)\binom{p-1}{k} \equiv (-1)^k \pmod{p}.
  2. Compute k=0p1(p1k)2\displaystyle\sum_{k=0}^{p-1} \binom{p-1}{k}^2 modulo pp.

Problem 14. Consider the linear system over the finite field Fp\mathbb{F}_p (with p>3p > 3 prime):

{ax+2y3(modp),x+ay5(modp).\begin{cases} ax + 2y \equiv 3 \pmod{p}, \\ x + ay \equiv 5 \pmod{p}. \end{cases}

For which aFpa \in \mathbb{F}_p does this system have a solution?


Problem 15. Let pp be an odd prime and gg a primitive root modulo pp.

  1. Prove that g(p1)/21(modp)g^{(p-1)/2} \equiv -1 \pmod{p}.
  2. For which odd primes pp is g-g still a primitive root modulo pp? Provide a proof.

Problem 16. Let nn be an integer strictly greater than 11. Prove that n4+4nn^4 + 4^n is never prime. (Hint: use the identity a4+4b4=(a2+2b2+2ab)(a2+2b22ab)a^4 + 4b^4 = (a^2 + 2b^2 + 2ab)(a^2 + 2b^2 - 2ab).)


Problem 17. Find all rational solutions to x2+y2=2x^2 + y^2 = 2. (Hint: use the substitution u=x+y2u = \frac{x+y}{2}, v=xy2v = \frac{x-y}{2}.)


Problem 18. Let pp be an odd prime and aa an integer not divisible by pp.

  1. Prove that y=0p1(y2+ap)=1\displaystyle\sum_{y=0}^{p-1} \left(\frac{y^2 + a}{p}\right) = -1, where the parentheses denote the Legendre symbol.
  2. Count the number of solutions (x0,y0)(x_0, y_0) to x2y2a(modp)x^2 - y^2 \equiv a \pmod{p}.

Problem 19. Consider the Diophantine equation x2+y2=z3x^2 + y^2 = z^3.

  1. Prove that if (x0,y0,z0)(x_0, y_0, z_0) is an integer solution with gcd(x0,y0)=1\gcd(x_0, y_0) = 1, then x0x_0 is odd and y0y_0 is even.
  2. Prove that in the Gaussian integer ring Z[1]\mathbb{Z}[\sqrt{-1}], the elements x0+y01x_0 + y_0\sqrt{-1} and x0y01x_0 - y_0\sqrt{-1} are coprime.
  3. Prove that there exist integers a,ba, b such that {x0=a(a23b2),y0=b(3a2b2),z0=a2+b2.\begin{cases} x_0 = a(a^2 - 3b^2), \\ y_0 = b(3a^2 - b^2), \\ z_0 = a^2 + b^2. \end{cases}

Problem 20. Consider the system of linear congruences:

{x5(mod12),xa(mod18).\begin{cases} x \equiv 5 \pmod{12}, \\ x \equiv a \pmod{18}. \end{cases}
  1. Prove that this system has a solution if and only if a5(mod6)a \equiv 5 \pmod{6}.
  2. For a=11a = 11, find all solutions.

Problem 21. Find all odd primes p>7p > 7 such that 105105 is a quadratic residue modulo pp. What is the Dirichlet density of this set of primes?


Problem 22. Let a1,a2,,ap12a_1, a_2, \ldots, a_{\frac{p-1}{2}} be all the quadratic residues modulo pp. Prove that

(xa1)(xa2)(xap12)xp121(modp).(x - a_1)(x - a_2)\cdots(x - a_{\frac{p-1}{2}}) \equiv x^{\frac{p-1}{2}} - 1 \pmod{p}.

Problem 23. Prove that the equation (x22)(x23)(x36)=0(x^2 - 2)(x^2 - 3)(x^3 - 6) = 0 has no integer solutions, yet for every prime pp, this equation has a solution modulo pp.


Problem 24. Consider the ring of Eisenstein integers Z[ω]\mathbb{Z}[\omega], where ω=e2πi/3\omega = e^{2\pi i/3}. For any x=a+bωZ[ω]x = a + b\omega \in \mathbb{Z}[\omega], define its norm by N(x)=a2ab+b2N(x) = a^2 - ab + b^2. Let α,βZ[ω]\alpha, \beta \in \mathbb{Z}[\omega] such that neither N(α)N(\alpha) nor N(β)N(\beta) is divisible by 33. Suppose α\alpha and β\beta are coprime in Z[ω]\mathbb{Z}[\omega].

  1. Must N(α)N(\alpha) and N(β)N(\beta) be coprime in Z\mathbb{Z}? If true, prove it; if false, provide a counterexample.
  2. Let gg be the greatest common divisor of N(α)N(\alpha) and N(β)N(\beta) in Z\mathbb{Z}. Prove that g1(mod3)g \equiv 1 \pmod{3}.

Problem 25. Prove that for any given positive integer kk, there exist infinitely many primes whose decimal representation ends in kk digits all equal to 11.


Problem 26. Let AA be the set of primes pp such that p1(mod3)p \equiv 1 \pmod{3}, and BB the set of primes pp such that p3(mod4)p \equiv 3 \pmod{4}. Find the Dirichlet density of AA, of BB, and of ABA \cap B.


Problem 27. Prove that every arithmetic progression

a,a+d,a+2d,,a+kd,a, a+d, a+2d, \ldots, a+kd, \ldots

must contain a composite number.


Problem 28.

  1. Let mm be a positive integer. Prove that if p=2m+1p = 2^m + 1 is prime, then mm is a power of 22.
  2. For n0n \ge 0, let Fn=22n+1F_n = 2^{2^n} + 1, called the Fermat numbers. Prove that if m>nm > n, then Fn(Fm2)F_n \mid (F_m - 2).
  3. Prove that if mnm \neq n, then gcd(Fm,Fn)=1\gcd(F_m, F_n) = 1. Use this to prove that there are infinitely many primes.

Problem 29. Find the last two decimal digits of 20266182026^{618}.


Problem 30. Let pp be an odd prime. Prove that every primitive root modulo pp is a quadratic non-residue modulo pp. For which odd primes pp are all quadratic non-residues also primitive roots?


Edit page
Share this post:

Previous Post
Gauss 和与二次互反律
Next Post
Advanced Algebra II — Quiz 2 Solutions