Square number
A square number, also known as a perfect square, is an integer that is the square of another integer, meaning it is the product of two identical integers.[1] For example, the square numbers include 0 (0²), 1 (1²), 4 (2²), 9 (3²), 16 (4²), 25 (5²), 36 (6²), 49 (7²), 64 (8²), and 81 (9²).[1] These numbers form a sequence where each term is given by the formula n^2, with n being a non-negative integer.[2] Square numbers exhibit several distinctive mathematical properties that distinguish them from other integers. One key property is that the square root of a perfect square is always an integer, unlike non-square numbers whose square roots are irrational.[3] Additionally, perfect squares always end in the digits 0, 1, 4, 5, 6, or 9, and no perfect square ends in 2, 3, 7, or 8.[4] The sum of the first n odd numbers equals n^2, providing a visual representation where square numbers can be constructed by arranging dots or objects into a square grid.[2] Even squares are multiples of 4, while odd squares are congruent to 1 modulo 8.[1] The concept of square numbers dates back to ancient mathematics, with Euclid defining a square number in his Elements as "equal multiplied by equal, or a number which is contained by two equal numbers."[5] They play a fundamental role in number theory, appearing in theorems such as Fermat's theorem on sums of two squares, which states that a prime number can be expressed as the sum of two squares if and only if it is of the form 4k+1.[1] In geometry and algebra, square numbers underpin calculations involving areas of squares and solutions to quadratic equations.[6]Fundamentals
Definition
A square number, also known as a perfect square, is an integer that results from multiplying an integer by itself, formally expressed as n^2 where n is any integer.[1] This includes positive integers, zero, and negative integers, with the square of a negative integer equaling the square of its positive counterpart, such as (-3)^2 = 9 = [3^2](/page/3-2).[1] Zero is included as a square number since $0^2 = 0.[7] Square numbers are distinct from the broader concept of squares in mathematics, which can apply to any real number; for instance, (\sqrt{2})^2 = 2, but 2 is not a square number because \sqrt{2} is not an integer.[8] The term "square" originates from the geometric context of squaring a length to find the area of a square, emphasizing the integer-based nature in this definition.[9]Notation
Square numbers are conventionally denoted using superscript notation, where the square of an integer n is written as n^2, representing n multiplied by itself.[1] The principal (non-negative) square root of a non-negative real number x is denoted by the radical symbol \sqrt{x}, which yields the unique non-negative value whose square equals x.[10] To express the largest perfect square less than or equal to a positive integer n, the notation \lfloor \sqrt{n} \rfloor^2 is used, where \lfloor \cdot \rfloor denotes the floor function, returning the greatest integer less than or equal to \sqrt{n}.[11] This construction identifies the square of the integer part of \sqrt{n}, providing a standard way to bound square numbers below a given value. In sequences and databases, square numbers are cataloged using established conventions, such as the On-Line Encyclopedia of Integer Sequences (OEIS) entry A000290, which lists the squares starting from n = 0: 0, 1, 4, 9, 16, ....[12] Although the equation x^2 = y may have two real solutions x = \pm \sqrt{y} for y > 0, square numbers themselves are defined as non-negative values, and the principal square root \sqrt{y} excludes the negative root by convention.[10] This ensures consistency in mathematical contexts where square numbers represent quantities like areas or counts, which cannot be negative.Examples and Illustrations
Sequence of Square Numbers
The sequence of square numbers consists of the squares of the non-negative integers, beginning with 0² = 0, 1² = 1, 2² = 4, 3² = 9, and continuing indefinitely.[12] This infinite sequence is strictly increasing for n ≥ 0 and contains no repetitions, as each successive term is larger than the previous one.[1] The initial terms of the sequence are presented in the following table for illustration:| n | n² |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 4 |
| 3 | 9 |
| 4 | 16 |
| 5 | 25 |
| 6 | 36 |
| 7 | 49 |
| 8 | 64 |
| 9 | 81 |
| 10 | 100 |
| 11 | 121 |
| 12 | 144 |
| 13 | 169 |
| 14 | 196 |
| 15 | 225 |
| 16 | 256 |
| 17 | 289 |
| 18 | 324 |
| 19 | 361 |
| 20 | 400 |
| 21 | 441 |
| 22 | 484 |
| 23 | 529 |
| 24 | 576 |
| 25 | 625 |
| 26 | 676 |
| 27 | 729 |
| 28 | 784 |
| 29 | 841 |
| 30 | 900 |
| 31 | 961 |
| 32 | 1024 |
Geometric Interpretation
Square numbers originate in geometry as the measures of areas enclosed by squares with integer side lengths. Specifically, for a positive integer n, the square number n^2 denotes the area of a square whose sides each measure n units, assuming unit length as the base measure. For example, a square with side length 3 units has an area of 9 square units.[1] This geometric concept traces back to ancient Babylonian mathematics around 2000 BCE, where square numbers were computed and tabulated on clay tablets for practical applications in land measurement and construction. These tablets, discovered at sites like Senkerah on the Euphrates, list squares of integers up to 59 and demonstrate their use in solving geometric problems, such as determining dimensions of rectangles with given areas through quadratic calculations.[14] Visually, square numbers are represented by arranging unit dots or points in a square lattice grid, where the side length n defines n rows and n columns of points, yielding n^2 total elements. For instance, the square number 16 appears as a 4×4 array of 16 dots, forming a compact square pattern that highlights the uniform tiling of the plane with unit squares.[1] As a class of figurate numbers, square numbers exemplify polygonal arrangements where dots form regular four-sided figures, distinguishing them from triangular or pentagonal counterparts in the broader family of such numerically representable shapes.[1] These geometric depictions, such as the square arrays for 1, 4, and 9, provide an intuitive link to their sequential progression.Mathematical Properties
Algebraic Properties
Square numbers play a central role in several key algebraic identities, particularly those involving expansions and factorizations of polynomials. The binomial expansion for the square of a sum provides one of the most basic examples: for any real numbers a and b, (a + b)^2 = a^2 + 2ab + b^2. This identity follows directly from the binomial theorem applied to exponent 2, where the coefficients are given by binomial coefficients.[15] A related form arises from the square of a difference: (a - b)^2 = a^2 - 2ab + b^2. These expansions highlight how square numbers a^2 and b^2 combine with cross terms to form the overall square. This binomial identity extends naturally to the square of a finite sum of n terms. For variables a_1, a_2, \dots, a_n, the expansion is \left( \sum_{i=1}^n a_i \right)^2 = \sum_{i=1}^n a_i^2 + 2 \sum_{1 \leq i < j \leq n} a_i a_j. Here, the first sum collects the individual square numbers, while the double sum accounts for pairwise products. This generalization is a direct consequence of distributing the square over the summation and applying the binomial case repeatedly.[16] For instance, with three terms a + b + c, it yields (a + b + c)^2 = a^2 + b^2 + c^2 + 2ab + 2ac + 2bc. Another essential identity is the difference of squares, which factors a difference of two square numbers into linear terms: a^2 - b^2 = (a - b)(a + b). This factorization is a polynomial identity that holds for all a and b, enabling simplification in algebraic manipulations and equation solving.[17] It is particularly useful in factoring higher-degree polynomials or resolving expressions in rings where such differences appear. The product of two numbers also relates directly to square numbers through the power rule: (ab)^2 = a^2 b^2. This follows from the exponentiation property (xy)^n = x^n y^n for positive integers n, with n=2 yielding the square case.[18] Combining this with the expansions above allows expressions like ((a + b)c)^2 = (a + b)^2 c^2 = (a^2 + 2ab + b^2) c^2, illustrating how square numbers propagate through products of sums. Square numbers are intrinsically linked to quadratic equations, where integer solutions often require perfect square discriminants. Consider the quadratic equation ax^2 + bx + c = 0 with integer coefficients a, b, c and a \neq 0. The roots given by the quadratic formula are rational if and only if the discriminant d = b^2 - 4ac is a perfect square. For the roots to be integers, these rational roots must additionally be integers, which requires conditions such as $2a dividing -b \pm \sqrt{d}.[19] For example, in the monic case x^2 + px + q = 0, integer roots exist precisely when p^2 - 4q is a square number. This connection underscores the role of square numbers in determining solvability over the integers.[20]Arithmetic Properties
Square numbers possess distinct divisibility properties within integer arithmetic. Specifically, any square number n^2 satisfies n^2 \equiv 0 \pmod{4} or n^2 \equiv 1 \pmod{4}, as even n = 2k yields (2k)^2 = 4k^2 \equiv 0 \pmod{4}, while odd n = 2k+1 yields (2k+1)^2 = 4k^2 + 4k + 1 \equiv 1 \pmod{4}.[1] In the prime factorization of a square number, every prime congruent to 3 modulo 4 must appear with an even exponent, a consequence of the fact that all exponents in the factorization of n^2 are even.[21] Multiplicatively, the product of two square numbers is always a square number. If m = a^2 and k = b^2 for integers a and b, then m \cdot k = (a b)^2, preserving the square form under multiplication.[1] Additively, square numbers exhibit constrained behaviors in sums. For instance, the sum of three consecutive squares (n-1)^2 + n^2 + (n+1)^2 = 3n^2 + 2 cannot equal another square m^2 for any integers n > 0 and m, as $3n^2 + 2 \equiv 2 \pmod{3} while squares are congruent to 0 or 1 modulo 3. A key formula governs the sum of the first n squares: \sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}. This can be derived by telescoping the difference of cubes: \sum_{k=1}^n \left[ (k+1)^3 - k^3 \right] = (n+1)^3 - 1^3 = \sum_{k=1}^n (3k^2 + 3k + 1) = 3 \sum_{k=1}^n k^2 + 3 \sum_{k=1}^n k + \sum_{k=1}^n 1. Substituting the known sums \sum k = \frac{n(n+1)}{2} and \sum 1 = n, and solving for \sum k^2 yields the formula.[1][22]Parity and Modular Behavior
Even and Odd Square Numbers
The parity of a square number is determined by the parity of its base integer. The square of an even integer is even, as expressed by the formula (2k)^2 = 4k^2 for any integer k, which is clearly divisible by 2.[23] Similarly, the square of an odd integer is odd, given by (2k+1)^2 = 4k^2 + 4k + 1 = 4(k^2 + k) + 1, which leaves a remainder of 1 when divided by 2.[23] Furthermore, every even square is divisible by 4, since $4k^2 is a multiple of 4.[24] For odd squares, they are congruent to 1 modulo 8, meaning (2k+1)^2 \equiv 1 \pmod{8}.[1] Examples of even squares include $2^2 = 4, $4^2 = 16, and $6^2 = [36](/page/36), all divisible by 4. Odd squares include [1](/page/1)^2 = 1, $3^2 = 9, and $5^2 = 25, each congruent to 1 modulo 8. This parity behavior implies that no square number is congruent to 2 or 3 modulo 4, as even squares are 0 modulo 4 and odd squares are 1 modulo 4.[24]Squares Modulo Small Integers
In number theory, the possible values of n^2 \mod m for integer n and fixed small positive integer m are known as the quadratic residues modulo m. These residues reveal patterns in the distribution of squares and are fundamental to understanding solvability of quadratic congruences. For prime moduli p, the Legendre symbol \left( \frac{a}{p} \right) provides a way to determine if a is a quadratic residue modulo p: it equals 1 if a is a nonzero quadratic residue, -1 if a quadratic nonresidue, and 0 if p divides a.[25] For modulo 3, the quadratic residues are 0 and 1, as $0^2 \equiv 0, $1^2 \equiv 1, and $2^2 \equiv 1 \pmod{3}, so 2 is not a residue.[25] Modulo 5, the residues are 0, 1, and 4, since $0^2 \equiv 0, $1^2 \equiv 1, $2^2 \equiv 4, $3^2 \equiv 4, and $4^2 \equiv 1 \pmod{5}, excluding 2 and 3.[25] Modulo 7, they are 0, 1, 2, and 4, with $0^2 \equiv 0, $1^2 \equiv 1, $2^2 \equiv 4, $3^2 \equiv 2, $4^2 \equiv 2, $5^2 \equiv 4, and $6^2 \equiv 1 \pmod{7}, so 3, 5, and 6 are nonresidues.[25][26] Modulo 8, the quadratic residues are 0, 1, and 4; specifically, squares of even integers are congruent to 0 or 4, while squares of odd integers are congruent to 1.[27] This aligns with the analysis of parity in squares, serving as a special case for moduli 2 and 4. The following table summarizes the quadratic residues modulo small integers up to 10, obtained by direct computation of k^2 \mod m for k = 0 to m-1:| Modulus m | Quadratic Residues |
|---|---|
| 2 | 0, 1 |
| 3 | 0, 1 |
| 4 | 0, 1 |
| 5 | 0, 1, 4 |
| 6 | 0, 1, 3, 4 |
| 7 | 0, 1, 2, 4 |
| 8 | 0, 1, 4 |
| 9 | 0, 1, 4, 7 |
| 10 | 0, 1, 4, 5, 6, 9 |