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. /A number theorist wants to prove that no integer of the form 8k + 7 is a sum of three squares of…
AdvancedMathematicsHigh School (11–12)Number TheoryproofNumericalOlympiad

A number theorist wants to prove that no integer of the form 8k + 7 is a sum of three squares of…

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.

A number theorist wants to prove that no integer of the form 8k+78k + 78k+7 is a sum of three squares of integers, so 777, 151515 and 232323 are not. First list the possible remainders of a square on division by 888. Then show that a sum of three of these remainders is never 777 modulo 888. Finally count the integers nnn with 1≤n≤1801 \le n \le 1801≤n≤180 that the proof rules out, and find the largest of them.

Check your answer

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

Need a reminder? The key ideaShowHide

a≡b(modm)a \equiv b \pmod ma≡b(modm) means m∣a−bm \mid a - bm∣a−b. Congruences add, subtract, multiply and take powers like equations. A small power congruent to 111 or −1-1−1 cuts a large exponent down:

ak≡1(modm) ⇒ aqk+r≡ar(modm).\displaystyle a^k \equiv 1 \pmod m \ \Rightarrow\ a^{qk + r} \equiv a^r \pmod m.ak≡1(modm) ⇒ aqk+r≡ar(modm).

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. Integers n=x2+y2+z2n = x^2 + y^2 + z^2n=x2+y2+z2 and the modulus 888.

Plan. List the squares modulo 888, add three of them in every way, and see that 777 never appears.

Step 1. Squares modulo 8. 02=00^2 = 002=0, 12=11^2 = 112=1, 22=42^2 = 422=4, 32=9≡13^2 = 9 \equiv 132=9≡1, 42=16≡04^2 = 16 \equiv 042=16≡0, 52=25≡15^2 = 25 \equiv 152=25≡1, 62=36≡46^2 = 36 \equiv 462=36≡4, 72=49≡17^2 = 49 \equiv 172=49≡1. So a square is 000, 111 or 444 modulo 888.

Step 2. Sums of three. Each term is 000, 111 or 444. The sums are 0,1,2,3,4,5,6,8,9,120, 1, 2, 3, 4, 5, 6, 8, 9, 120,1,2,3,4,5,6,8,9,12, which modulo 888 are 0,1,2,3,4,5,6,0,1,40, 1, 2, 3, 4, 5, 6, 0, 1, 40,1,2,3,4,5,6,0,1,4. The remainder 777 is missing.

Step 3. Conclusion. So x2+y2+z2≢7(mod8)x^2 + y^2 + z^2 \not\equiv 7 \pmod 8x2+y2+z2≡7(mod8), and no number 8k+78k + 78k+7 is a sum of three squares. Proof complete.

Step 4. The count. The numbers are 7,15,…,1757, 15, \dots, 1757,15,…,175, since 175=8×21+7175 = 8 \times 21 + 7175=8×21+7. There are 21+1=2221 + 1 = 2221+1=22 of them.

Check. 183=8×22+7183 = 8 \times 22 + 7183=8×22+7 is above 180180180, so 175175175 is the last one.

Answer: 222222 numbers from 111 to 180180180, the largest being 175175175.

What if? A famous theorem of Legendre says that these, together with the numbers 4a(8k+7)4^a(8k + 7)4a(8k+7), are the only positive integers that are not sums of three squares. The proof of that converse is much harder.

Log in to save this for later
← All Problems
← Show that n⁵ - n is a multiple of 30 for every integer n…A twelve-digit serial number is N = 123 456 789 123… →
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 →