The square numbers 1,4,9,16,25,… are among the most recognizable sequences in mathematics. Each is the product of an integer with itself, each can be visualized as dots filling a square grid, and each is a sum of consecutive odd numbers. Their properties connect to arithmetic sequences, triangular numbers, and divisibility.
Definition
The n-th square number is:
Sn=n2
The name reflects the geometric construction: arrange n2 dots in a square grid with n rows and n columns. The first square numbers are:
1,4,9,16,25,36,49,64,81,100,…
A positive integer is called a perfect square if it equals n2 for some integer n. Testing whether a number is a perfect square amounts to checking whether its square root is an integer.
Recursive Form and Odd Number Sums
Each square number can be built from the previous one by adding an L-shaped border — a gnomon — containing 2n−1 dots:
S1=1,Sn=Sn−1+(2n−1)
The increments 1,3,5,7,9,… are the odd numbers, which form an arithmetic sequence with first term 1 and common difference 2. Summing all the increments gives:
n2=1+3+5+⋯+(2n−1)
Every perfect square is a sum of consecutive odd numbers starting from 1. This identity can be verified by the arithmetic series formula: the sum of the first n odd numbers is 2n(1+(2n−1))=n2.
The difference between consecutive squares is always odd: Sn−Sn−1=2n−1. This means no two consecutive integers are both perfect squares — there is always an odd gap between neighboring squares, and that gap widens as n grows.
Properties
Perfect squares have distinctive divisibility patterns. A perfect square modulo 4 is always 0 or 1 — never 2 or 3. This is because even numbers squared give multiples of 4, and odd numbers squared give 1 more than a multiple of 4. Similarly, a perfect square modulo 3 is always 0 or 1 — never 2.
The last digit of a perfect square can only be 0,1,4,5,6, or 9. Any integer ending in 2,3,7, or 8 is immediately ruled out as a perfect square, without computing any square root.
Consecutive perfect squares are always coprime: gcd(n2,(n+1)2)=1, because gcd(n,n+1)=1 and the GCD of squares equals the square of the GCD.
The number of perfect squares up to N is ⌊N⌋. Perfect squares become increasingly sparse — the gap between n2 and (n+1)2 is 2n+1, which grows linearly. Among the first 100 integers, 10 are perfect squares; among the first 10,000, only 100 are.
Sum of Squares
The sum of the first n square numbers is:
k=1∑nk2=6n(n+1)(2n+1)
One derivation uses the telescoping identity (k+1)3−k3=3k2+3k+1. Summing both sides from k=1 to n:
(n+1)3−1=3∑k2+3∑k+n
Substituting ∑k=2n(n+1) and solving for ∑k2 gives the result.
For example, the sum of the first 5 squares is 1+4+9+16+25=55, which matches 65⋅6⋅11=55.
This formula contrasts with the triangular number sum ∑k=2n(n+1), which is quadratic in n. The sum of squares is cubic — each additional term contributes a squared value, making the total grow faster.
Every perfect square is the sum of two consecutive triangular numbers. For n=4: 16=T4+T3=10+6. The geometric proof is direct: cut a square grid of n2 dots along the diagonal staircase. The dots on and above the staircase form a triangle with n rows (Tn dots), and the dots below form a triangle with n−1 rows (Tn−1 dots).
Another connection runs through Pythagorean triples — sets of three positive integers (a,b,c) satisfying a2+b2=c2. Every primitive Pythagorean triple can be generated by choosing integers m>n>0 with gcd(m,n)=1 and opposite parity, then setting:
a=m2−n2,b=2mn,c=m2+n2
The triple (3,4,5) comes from m=2,n=1; the triple (5,12,13) from m=3,n=2. Pythagorean triples connect square numbers to geometry — each triple defines a right triangle with integer side lengths.