HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Prove that n⁷ - n is a multiple of 42 for every integer n…
AdvancedMathematicsHigh School (11–12)Number TheoryproofNumericalOlympiad

Prove that n⁷ - n is a multiple of 42 for every integer n…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

Prove that n7−nn^7 - nn7−n is a multiple of 424242 for every integer nnn. Use the first form of Fermat's theorem, ap≡a(modp)a^p \equiv a \pmod pap≡a(modp), for each of the primes 222, 333 and 777. For 222 and 333 you must first lift a2≡aa^2 \equiv aa2≡a or a3≡aa^3 \equiv aa3≡a to the seventh power. Then show that 424242 is the largest integer with this property. Give that integer and the value of n7−nn^7 - nn7−n at n=2n = 2n=2.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

For a prime ppp with p∤ap \nmid ap∤a, Fermat's little theorem gives ap−1≡1a^{p-1} \equiv 1ap−1≡1, so exponents can be reduced modulo p−1p - 1p−1:

aq(p−1)+r≡ar(modp).\displaystyle a^{q(p-1) + r} \equiv a^r \pmod p.aq(p−1)+r≡ar(modp).

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Given. f(n)=n7−nf(n) = n^7 - nf(n)=n7−n.

Step 1. Modulo 7. Fermat's first form gives n7≡n(mod7)n^7 \equiv n \pmod 7n7≡n(mod7) at once.

Step 2. Modulo 3. Fermat gives n3≡nn^3 \equiv nn3≡n. Then n7=n3⋅n3⋅n≡n⋅n⋅n=n3≡n(mod3)n^7 = n^3 \cdot n^3 \cdot n \equiv n \cdot n \cdot n = n^3 \equiv n \pmod 3n7=n3⋅n3⋅n≡n⋅n⋅n=n3≡n(mod3).

Step 3. Modulo 2. n2≡nn^2 \equiv nn2≡n, so every power nk≡nn^k \equiv nnk≡n for k≥1k \ge 1k≥1. In particular n7≡n(mod2)n^7 \equiv n \pmod 2n7≡n(mod2).

Step 4. Combine. 222, 333 and 777 all divide f(n)f(n)f(n) and are coprime, so 42∣f(n)42 \mid f(n)42∣f(n).

Step 5. Best possible. f(2)=128−2=126=3×42f(2) = 128 - 2 = 126 = 3 \times 42f(2)=128−2=126=3×42 and f(3)=2187−3=2184=52×42f(3) = 2187 - 3 = 2184 = 52 \times 42f(3)=2187−3=2184=52×42. Here gcd⁡(126,2184)=42\gcd(126, 2184) = 42gcd(126,2184)=42, so any integer dividing every f(n)f(n)f(n) divides 424242.

Answer: 424242 is the largest integer that always divides n7−nn^7 - nn7−n, and f(2)=126f(2) = 126f(2)=126. Proof complete.

What if? The same reasoning shows n13−nn^{13} - nn13−n is always a multiple of 2×3×5×7×13=27302 \times 3 \times 5 \times 7 \times 13 = 27302×3×5×7×13=2730: these are the primes ppp with p−1p - 1p−1 dividing 121212.

Log in to save this for later
← All Problems
← A coding club sets two remainders as a warm-up…A quick primality test says: if aⁿ⁻¹ not≡ 1 pmod n for some a coprime to n, then n is composite… →
More onNumber Theory

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. The triangular numbers are 1, 3, 6, 10, …, where the nth one is (n(n + 1))/2…Advanced
  2. Prove that the equation x³ + y³ + z³ = n has no solution in integers when n leaves remainder 4 or 5…Advanced
  3. Find every triple of positive integers a ≤ b ≤ c with 1/a + 1/b + 1/c = 1, and prove that there are…Advanced
  4. Find all pairs of positive integers (x, y) with x² - y² = 945…Hard
  5. A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…Advanced
All problems on this topic →