Maths WorkshopMaths problems with full solutions
Exercise 2193Number theory › PrimesM1Added 3 Nov 2026

The Fermat quotient

#Fermat quotient#prime#congruence

Statement

Define the Fermat quotient qp(a)=(ap−1−1)/pq_p(a)=(a^{p-1}-1)/p for p∤ap\nmid a and compute q5(2)q_5(2).

Hint

Compute 24−12^4-1 and divide by 55.

Show solutionHide solution

Solution

Definition. qp(a)=(ap−1−1)/pq_p(a)=(a^{p-1}-1)/p; this is an integer by Fermat's little theorem.

Compute. q5(2)=(24−1)/5=15/5=3q_5(2)=(2^4-1)/5=15/5=3.

Properties. qp(ab)≡qp(a)+qp(b)(modp)q_p(ab)\equiv q_p(a)+q_p(b)\pmod p; qp(ak)≡k qp(a)(modp)q_p(a^k)\equiv k\,q_p(a)\pmod p.

Conclusion. q5(2)=3q_5(2)=3.

Application. Wieferich primes satisfy qp(2)≡0(modp)q_p(2)\equiv0\pmod p.