Recognising, Building and Reasoning About Perfect Squares

What makes a number a perfect square?

An integer N is a perfect square if N = n2 for some integer n. The first few are 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100. The most useful way to think about a square is through its prime factorization: squaring doubles every exponent, so


For a positive integer N, N is a perfect square exactly when every prime in its factorization has an even exponent. The number 0 is also a perfect square, but it is handled separately because it has no prime factorization.


For example, 42 = 2 · 3 · 7, so 422 = 1764 = 22 · 32 · 72. Every exponent is 2. By contrast, 50 = 2 · 52 is not a square, because the exponent on 2 is odd.


Multiplying by one more 2 repairs it: 50 × 2 = 100 = 102. The smallest multiplier that makes a number square is the product of the primes that appear to an odd power, each used once.

Quick screens that rule a number out

Factoring a large number takes time, so it helps to have fast tests. Each test below is a necessary condition: failing any one proves a number is not a square, but passing all of them proves nothing.


Screen

What squares allow

Why

Last digit

0, 1, 4, 5, 6, 9

The last digit of n2 depends only on the last digit of n; checking 0 through 9 gives only these.

Trailing zeros

Every nonzero perfect square whose decimal representation ends in 0 has an even positive number of trailing zeros; 0 is handled separately.

For a nonzero integer root, each factor of 10 in n becomes a factor of 100 in n2.

Digital root (repeated digit sum)

0, 1, 4, 7, 9

The digital root tracks the remainder on division by 9. The value 0 occurs for the number 0; a nonzero square divisible by 9 has digital root 9.

Remainder on division by 4

0 or 1

(2k)2 = 4k2, and (2k + 1)2 = 4(k2 + k) + 1.


To find a number's remainder on division by 4, you only need its last two digits, because 100 is a multiple of 4.


Example. Is 3574 a square? It ends in 4, so the last-digit screen passes. Its last two digits are 74, and 74 = 72 + 2, so the remainder on division by 4 is 2. Squares never leave remainder 2, so 3574 is not a square. You can confirm it sits between 592 = 3481 and 602 = 3600.

The gaps between squares are odd numbers

Expanding (n + 1)2 = n2 + 2n + 1 shows that consecutive squares differ by 2n + 1, where n is the smaller root. For example, 202 − 192 = 400 − 361 = 39 = 2(19) + 1. Two consequences:


  • The gaps are 1, 3, 5, 7, ..., so adding the first n odd numbers climbs from 0 to n2: 1 + 3 + 5 + ... + (2n − 1) = n2. For instance, 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 = 64 = 82. The last odd number, 15, equals 2(8) − 1, which is how you count the terms.
  • Any nonnegative integer that is not a square lies strictly between two consecutive squares. Bracketing a nonnegative number this way estimates its square root and proves it is not a square.

Using remainders to prove "never"

Remainder arguments can show that a whole family of numbers contains no squares. For instance, every integer is even or odd, so every square leaves remainder 0 or 1 on division by 4.


Any expression that always leaves remainder 2 or 3 can therefore never be a perfect square, no matter how large the numbers get. A single counterexample search can never prove this; the remainder argument does it in one line.



Exactly one of the following numbers is a perfect square. Which one?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

What is the smallest positive integer k such that 540k is a perfect square?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Two consecutive perfect squares differ by 131. What is the larger of the two squares?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors