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. /The square of 376 is 141 376, which ends in 376 again…
AdvancedMathematicsHigh School (11–12)Number TheoryNumericalOlympiad

The square of 376 is 141 376, which ends in 376 again…

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.

The square of 376376376 is 141 376141\,376141376, which ends in 376376376 again. Find every xxx with 0≤x<10000 \le x < 10000≤x<1000 and x2≡x(mod1000)x^2 \equiv x \pmod{1000}x2≡x(mod1000). Split the modulus as 1000=8×1251000 = 8 \times 1251000=8×125 and use the Chinese remainder theorem. Give the number of solutions and the two solutions that are not 000 or 111, and say why x(x−1)x(x - 1)x(x−1) makes the split easy.

Check your answer

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

Need a reminder? The key ideaShowHide

With pairwise coprime moduli, a system x≡ai(modmi)x \equiv a_i \pmod{m_i}x≡ai​(modmi​) has one solution modulo M=m1m2⋯mkM = m_1 m_2 \cdots m_kM=m1​m2​⋯mk​. Lift one congruence at a time:

x=a1+m1t,then reduce modulo m2.\displaystyle x = a_1 + m_1 t, \quad \text{then reduce modulo } m_2.x=a1​+m1​t,then reduce modulo m2​.

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. x(x−1)≡0(mod1000)x(x - 1) \equiv 0 \pmod{1000}x(x−1)≡0(mod1000).

Plan. Split into 888 and 125125125, and use that xxx and x−1x - 1x−1 share no factor.

Step 1. Modulo 8. 8∣x(x−1)8 \mid x(x - 1)8∣x(x−1). The numbers xxx and x−1x - 1x−1 are coprime, so all of 888 goes into one of them: x≡0x \equiv 0x≡0 or x≡1(mod8)x \equiv 1 \pmod 8x≡1(mod8). The same holds modulo 125125125.

Step 2. Four pairs. The pairs (0,0)(0, 0)(0,0) and (1,1)(1, 1)(1,1) give x=0x = 0x=0 and x=1x = 1x=1.

Step 3. x≡0(mod125)x \equiv 0 \pmod{125}x≡0(mod125) and x≡1(mod8)x \equiv 1 \pmod 8x≡1(mod8). Try x=125tx = 125tx=125t: 125≡5(mod8)125 \equiv 5 \pmod 8125≡5(mod8), so 5t≡15t \equiv 15t≡1, t≡5t \equiv 5t≡5. So x=625x = 625x=625.

Step 4. x≡1(mod125)x \equiv 1 \pmod{125}x≡1(mod125) and x≡0(mod8)x \equiv 0 \pmod 8x≡0(mod8). This is 1−625+1000=3761 - 625 + 1000 = 3761−625+1000=376, since xxx and 1−x1 - x1−x swap the two roles.

Check. 6252=390 625625^2 = 390\,6256252=390625 and 3762=141 376376^2 = 141\,3763762=141376. Both end in themselves.

Answer: 444 solutions: 000, 111, 376376376 and 625625625.

What if? Modulo 10k10^k10k there are always exactly four solutions, and the two non-trivial ones always add up to 10k+110^k + 110k+1.

Log in to save this for later
← All Problems
← A farmer counts the eggs in a basket. Taken two, three, four, five or six at a time, one egg is…Two bells ring on their own schedules. A number x of minutes is wanted with x ≡ 5 pmod12 and x ≡ 11… →
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 →