Site map 

 Contact Graeme 

 Skip Navigation LinksMath Help > Number Theory > Squares > Perfect Squares

Theorems and Factoids Involving Perfect Squares

A "perfect square" is a number that can be expressed as k2, where k is an integer.

Theorem 0: If integer N>1 is not a perfect square, then sqrt(N) is irrational -- i.e. sqrt(N) cannot be expressed as a/b, where a and b are integers.

Proof by contradiction:

Suppose N > 1 is not a perfect square, and suppose that sqrt(N) = a/b  for some positive integers a and b, and that b is the smallest positive  integer denominator for which this is true.

Then b2 < N b2 = a2,  because N > 1, so 0 < b < a.

Now divide a by b, obtaining quotient q  and remainder r, so a = q b + r, with 0 <= r < b.

Now if r = 0, we have a = q b, and a/b = q, so N = q2, and N is a perfect square, a contradiction. This means that r cannot be zero, and so 0 < r = a - q b < b. Now

N b2 = a2
N b2 - q a b = a2 - q a b
b(N b - q a) = a (a - q b)
(N b - q a)/(a - q b) = a/b = sqrt(N)

This contradicts the minimality of b, since 0 < a - q b < b. This contradiction means that no such integers a and b can exist, and sqrt(N) is irrational.

Note: this proof is similar to an Infinite Descent proof, in that whenever a fraction a/b can be found equal to sqrt(N), a fraction in lower terms (N b - q a)/(a - q b) can be found.  The only thing that makes this a proof by contradiction and not by infinite descent is the assertion right at the beginning that a/b is in lowest terms.

Corollary 1:

If sqrt(N) is a rational number, and N is an integer, then N is a perfect square.  This is the contrapositive of Theorem 0, so it can be proved immediately by contradiction: suppose sqrt(N) is rational but N is not a perfect square.  By Theorem 0, sqrt(N) is irrational, a contradiction.

Corollary 2:

Any integer which is a ratio of squares is a square.   Let integer N=a2/b2.  Then sqrt(N)=a/b, a rational number.  By Corollary 1, N is a perfect square.

Theorem 1: If b is an integer, and a is a non-zero integer that is a perfect square, then the following statement is true: ab is a perfect square if and only if b is a perfect square.

Proof (if):

integers r and s exist such that r2=a, and s2=b.
rs is an integer, and (rs)2=r2s2=ab

(only if):

integers r and q exist such that r2=a, and q2=ab
q2/r2 = ab/a = b
q/r = sqrt(b)
q/r is an integer by the corollary of Theorem 0, above.

Theorem 2: If a and b are relatively prime, then ab is a perfect square if and only if both a and b are perfect squares.

Proof (if):

integers r and s exist such that r2=a, and s2=b.
rs is an integer, and (rs)2=r2s2=ab

(only if):

(if ab is a perfect square then both a and b are perfect squares)

Assume for purposes of contradiction that a is not a perfect square.
if b is a perfect square, then ab is not a perfect square by Theorem 1.
So we will assume b is also not a perfect square.

Let pn be an odd prime power (that is, n is odd) that divides a.
Such an odd prime power exists because a is not a perfect square.
Note that p does not divide b because a and b are coprime.
So pn is the largest power of p that divides ab, and n is odd.

This contradicts the assertion that ab is a perfect square.

Factoid 3: Integers a,b,c,d exist such that the sum of all four of them and the sum of each pair of them are squares.

An example is 386, 2114, 3970, 10430. These numbers satisfy:


Sketch of a non-brute-force solution:

The sum of all four (a+b+c+d) is the square of the right-hand side of a Pythagorean triple in three different ways, so it has to be divisible by a handful of prime factors, each of which is 1 mod 4 (or else the prime 2).  One of these is 130=2*5*13.

Internet references

IBM's Ponder This: December, 2002 - Find four distinct integers a,b,c,d such that 100 <= a,b,c,d <= 12000 and the sum of "all" the four of them and the sum of "every" two of them are perfect squares.

Related Pages in this website

Irrationality Proofs -- Proofs that π and e are irrational.

Pythagorean Theorem

Prove that the area of a right triangle with integer sides is not a perfect square.

Infinite Descent -- a method of proving theorems in which whenever a set of integers is found to have a certain property, a set of smaller integers can be found to have the same property.

Arithmetic Sequence of Perfect Squares, page 3 -- If a2, b2, c2 are in arithmetic sequence, why is their constant difference a multiple of 24?  Look at the second answer to this question for the relationship between Pythagorean Triples and this arithmetic sequence of squares.

Basic Number Theory Definitions -- including some theorems involving GCDs, prime numbers, and squares.


The webmaster and author of this Math Help site is Graeme McRae.