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
  • Earth and Environmental Science
  • 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 by cases that for every integer n, n² leaves remainder 0 or 1 when divided by 3…
AdvancedMathematicsHigh School (11–12)Mathematical ReasoningproofNumericalBoard Exam
+2 more exams
A-LevelIB
A-LevelIB

Prove by cases that for every integer n, n² leaves remainder 0 or 1 when divided by 3…

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 by cases that for every integer nnn, n2n^2n2 leaves remainder 000 or 111 when divided by 333. Use your result to prove that no number of the form 3m+23m + 23m+2 is a perfect square. Then count two things. How many perfect squares from 111 to 100100100 leave remainder 222 on division by 333? For how many whole numbers nnn from 111 to 303030 does n2n^2n2 leave remainder 111? Explain the second count with your cases.

Check your answer

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

Need a reminder? The key ideaShowHide

Contradiction: assume the claim is false and reach something impossible. Cases: split the possibilities so that every one is covered, and prove the claim in each. Squares leave remainder 000 or 111 on division by 333.

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.

Step 1. The cases.

  • n=3kn = 3kn=3k: n2=3(3k2)n^2 = 3(3k^2)n2=3(3k2), remainder 000.
  • n=3k+1n = 3k + 1n=3k+1: n2=3(3k2+2k)+1n^2 = 3(3k^2 + 2k) + 1n2=3(3k2+2k)+1, remainder 111.
  • n=3k+2n = 3k + 2n=3k+2: n2=3(3k2+4k+1)+1n^2 = 3(3k^2 + 4k + 1) + 1n2=3(3k2+4k+1)+1, remainder 111.

Every integer falls in one case, so the remainder is always 000 or 111.

Step 2. Numbers 3m+23m + 23m+2. They leave remainder 222, which no square leaves. So none is a perfect square.

Step 3. First count. So 000 perfect squares from 111 to 100100100 leave remainder 222.

Step 4. Second count. Remainder 111 comes from the nnn that are not multiples of 333. From 111 to 303030 there are 101010 multiples of 333, so 30−10=2030 - 10 = 2030−10=20 values.

Check. n=5n = 5n=5: 25=3×8+125 = 3 \times 8 + 125=3×8+1, remainder 111. n=6n = 6n=6: 36=3×1236 = 3 \times 1236=3×12, remainder 000.

Answer: 000 squares, and 202020 values of nnn.

Log in to save this for later
← All Problems
← Prove by contradiction that there are no integers a and b with 6a + 9b = 100…Next →
More onMathematical Reasoning

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Proof by contradiction and by casesValid Arguments and Methods of Proof

More on this topic

  1. Prove by contradiction that there are no integers a and b with 6a + 9b = 100…Advanced
  2. Prove by contradiction that √3 is irrational…Hard
  3. Prove by exhaustion that no perfect square ends in the digit 2, 3, 7 or 8…Advanced
  4. The formula f(n) = n² + n + 41 gives a prime for n = 0, 1, 2, … for a long time…
Advanced
  • For integers a and b, prove that if a + b ≥ 15, then a ≥ 8 or b ≥ 8…Hard
  • All problems on this topic →