Concept stop · What is it?

Perfect Squares

In the Chinese book: 完全平方数

Squares never leave some remainders mod 3, 4, 8. Pick the right modulus.

📖 §2.5 of 《整除、同余与不定方程》M13 Prime Factor Analysis lineM14 Choosing a Good Modulus line

Before this stop, visit:Odd and Even Numbers (Method)

Hands first, words secondClick through the rows one by one. In each row, which remainders are crossed out because they never occur?

Loading figure…

Try this

  1. Click the row: only and are filled in. Can a number that leaves remainder when divided by be a square?
  2. Click and . Mod , only three of the eight remainders are filled in. How much does that rule out at a stroke?
  3. Click : this row is about the last digit of a square. Which digits can never be the last digit of a square?
  4. Look at the small table “ and ” on the right. Is the second row symmetric? Why do and have squares with the same remainder?
  5. Switch to “Cubes” and look at and ; switch to “4th powers” and look at .

The squares of integers, , are called perfect squares. To find their remainders mod , you only need to work out once each (the method from the residue systems stop). The three most useful rows are worth learning by heart:

Predict first

How many possible remainders does the square of an odd number leave when divided by ?

Choose an answer first; then you can see the result.

Why

The biggest use of a remainder table is proving that an equation has no integer solutions. There is only one hard part: choosing the modulus.

Does x² + y² = 2023 have integer solutions?

Step 1 / 5
Loading figure…
  1. Try mod 3 first

    Squares leave or mod , so the sum of two squares can leave : anything at all. The right side, , leaves . No contradiction.

Two more tools

The barcode. By the Fundamental Theorem of Arithmetic, is a perfect square every exponent in its prime factorization is even. So the number of divisors of a square, , is odd, and only squares have this property.

Squeezing. There are no squares strictly between two neighboring squares and . So if you can show that a number lies strictly between them, it is not a square. For example, when ,

so is never a perfect square.

Remove one condition

Break it

Counterexample lab: remove one condition

Conclusion: if is a perfect square, then and are each perfect squares

and are coprime: each prime's bar appears on one side only. Every exponent of is even, so every exponent of and of must be even too.

Loading figure…

Practice

Exercise 1Basic

Which digits can never be the last digit of a perfect square? List them all.

Exercise 2Basic

How many perfect squares are there in the sequence ?

Exercise 3Advanced

Find the positive integer for which is a perfect square.

Exercise 4Challenge

Prove that a positive integer that leaves remainder when divided by cannot be written as a sum of three squares of integers.

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

The remainders fit, so it must be a square

The wrong step: leaves when divided by and when divided by , both allowed for squares, so is a square.
What went wrong? Think first, then open

Diagnosis “A square leaves or when divided by ” is a condition every square must satisfy, not one that is enough. Plenty of numbers leave remainder : are not squares.

The right step: A remainder table can only rule things out: if the remainder is wrong, it is definitely not a square. To show that it is one, you have to find the number: , so sits strictly between two neighboring squares and is not a square.

“A remainder table rules out; it does not certify”

Exhibit

The product is a square, so each factor is a square

The wrong step: is a perfect square, so and are both perfect squares.
What went wrong? Think first, then open

Diagnosis , but neither nor is a square. The exponent of the prime is : even in total, but odd in each factor.

The right step: It is true with one extra condition, : when they are coprime, each prime appears on one side only, so if its exponent is even, it is even on that side.

“Coprime first, then each one is a square”