Squares and Square Roots

Take any square tile and measure its side: 1,2,3,5,81, 2, 3, 5, 8 centimetres. Now work out its area — 1,4,9,25,641, 4, 9, 25, 64 square centimetres. Every one of those areas is a side multiplied by itself, and the special family of numbers that comes out — 1,4,9,16,25,36,…1, 4, 9, 16, 25, 36, \ldots — is the subject of this whole chapter. They are called square numbers or perfect squares, and once you know how to spot them, build them and undo them, a surprising amount of arithmetic gets faster and a surprising amount of geometry gets easier. This chapter has two halves that are exact mirror images of each other. The first half asks: given a number nn, what is n2n^2? You will meet quick shortcuts for squaring two-digit numbers without long multiplication, a beautiful pattern connecting squares to sums of consecutive odd numbers, rules that tell you instantly whether a number's last digit rules it out from being a square, and the recipe for Pythagorean triplets — three whole numbers, like 3,4,53, 4, 5, that fit a2+b2=c2a^2+b^2=c^2 and describe the sides of a right triangle. The second half asks the reverse question: given a number NN that is a perfect square, what is N\sqrt{N}? You will learn three genuinely different methods — repeated subtraction of odd numbers, prime factorisation, and the powerful long-division method that also works on decimals — and see exactly why each one works, not just how to follow the steps. Squares and square roots are not a detour from the rest of mathematics; they are a tool you will keep reaching for. The Pythagoras theorem you already know needs a square root to finish almost every problem. Areas of squares, diagonal lengths, and later the quadratic formula in Class 10 all lean on the ideas built here. By the end of this article you should be able to look at a number, judge quickly whether it could possibly be a perfect square, and — if it is — find its exact square root by hand, with no calculator, using whichever method suits the size of the number.

Key takeaways
  • A perfect square (square number) is any m=n2m = n^2 where nn is a natural number; the first several are 1,4,9,16,25,36,49,64,81,1001, 4, 9, 16, 25, 36, 49, 64, 81, 100.
  • A perfect square can end only in 0,1,4,5,60, 1, 4, 5, 6 or 99 — but ending in one of these digits does not guarantee it is a perfect square.
  • A perfect square always has an even number of zeros at its end, and squares of even numbers are even while squares of odd numbers are odd.
  • The sum of the first nn odd natural numbers is always n2n^2; equivalently, (n+1)2−n2=2n+1(n+1)^2 - n^2 = 2n+1, so exactly 2n2n non-square numbers lie strictly between n2n^2 and (n+1)2(n+1)^2.
  • Two-digit and three-digit squares can be found without long multiplication using (a+b)2=a(a+b)+b(a+b)(a+b)^2 = a(a+b) + b(a+b), and numbers ending in 55 follow the shortcut (a5)2=a(a+1) hundred+25(a5)^2 = a(a+1)\ \text{hundred} + 25.
  • A Pythagorean triplet is a set of three natural numbers a,b,ca, b, c with a2+b2=c2a^2+b^2=c^2; for any m>1m > 1, the numbers 2m, m2−1, m2+12m,\ m^2-1,\ m^2+1 always form one.
  • Square root (x\sqrt{\phantom{x}}) is the inverse of squaring; every positive perfect square has two integer square roots (one positive, one negative), but the symbol x\sqrt{\phantom{x}} always denotes the positive (principal) one.
  • Square roots can be found by repeated subtraction of consecutive odd numbers, by prime factorisation (pairing equal factors), or by the long-division method, which also extends to decimals by bracketing digits in pairs from the decimal point.
  • Key idea: a number is a perfect square exactly when its prime factors can be grouped into pairs, and every method in this chapter — digit patterns, odd-number sums, factor pairing, or long division — is really a different way of testing or undoing that one pairing condition.
The core insight

A natural number is a perfect square precisely when its prime factorisation splits into complete pairs, and squaring and taking a square root are exact inverse operations built entirely on that pairing.

What this chapter covers

This article follows the chapter's own order, for first-time learning or fast revision alike.

  • Square numbers and properties — the definition, and digit-ending or zero-counting rules that reject non-squares at a glance.
  • Patterns — sums of consecutive odd numbers, the gap between consecutive squares, and (a+1)(a−1)=a2−1(a+1)(a-1)=a^2-1.
  • Squaring without multiplying — the distributive shortcut, and the special rule for numbers ending in 55.
  • Pythagorean triplets — the formula 2m, m2−1, m2+12m,\ m^2-1,\ m^2+1 that generates infinitely many of them.
  • Square roots and their meaning — the inverse of squaring, and the convention of the positive (principal) root.
  • Three methods for square roots — repeated subtraction, prime factorisation, and long division, including decimals.

The core ideas

Square numbers: the basic definition

A natural number mm is called a square number, or perfect square, if it can be written as the square of another natural number:

m=n2,n∈{1,2,3,…}.(1)m = n^2, \qquad n \in \{1, 2, 3, \ldots\}. \qquad (1)

where: nn is any natural number and mm is the perfect square it produces. So 1,4,9,16,25,…1, 4, 9, 16, 25, \ldots are perfect squares because 1=121=1^2, 4=224=2^2, 9=329=3^2, and so on, while a number like 3232 is not, because 52=255^2=25 and 62=366^2=36 and no natural number sits between 55 and 66. This gap test — check the squares of the two nearest integers and see if your number falls exactly on one of them — is the most basic way to decide whether a small number is a perfect square.

Properties: digit endings and zero counts

Look down the list of squares from 121^2 to 20220^2 and a pattern jumps out at the units place: every square ends in 0,1,4,5,60, 1, 4, 5, 6 or 99, and never in 2,3,72, 3, 7 or 88. This gives an instant rejection test — a number ending in 2,3,72, 3, 7 or 88 can never be a perfect square. The reverse is not true, and that is the single most important warning in this chapter (see the misconception box below): a number ending in 1,4,5,6,91, 4, 5, 6, 9 or 00 still has to be checked properly, because plenty of such numbers are not squares at all. A second property concerns trailing zeros. Since 102=10010^2=100, 1002=10000100^2=10000 and 7002=490000700^2=490000, a number with kk zeros at its end has a square with exactly 2k2k zeros. So a perfect square can only ever have an even number of zeros at its end — a number like 6400064000 (three zeros) is automatically disqualified. A third property links squares to even and odd numbers: the square of an even number is always even, and the square of an odd number is always odd, because (2k)2=4k2(2k)^2=4k^2 is even while (2k+1)2=4k2+4k+1(2k+1)^2=4k^2+4k+1 is odd.

Patterns: odd numbers, gnomons and gaps between squares

The richest pattern in the chapter is this one: the sum of the first nn odd natural numbers is always the nnth square number.

1+3+5+⋯+(2n−1)=n2.(2)1 + 3 + 5 + \cdots + (2n-1) = n^2. \qquad (2)

where: the left side has exactly nn terms, the odd numbers from 11 up to 2n−12n-1. You can see this geometrically: start with one square dot (121^2), wrap it in an L-shaped border of 33 dots to get a 2×22\times2 square (44), wrap that in a border of 55 dots to get 3×33\times3 (99), and so on — each border, called a gnomon, adds the next odd number and turns an n×nn\times n square into an (n+1)×(n+1)(n+1)\times(n+1) square. This is also why the difference between consecutive squares is always odd:

(n+1)2−n2=2n+1.(3)(n+1)^2 - n^2 = 2n+1. \qquad (3)

where: nn is any natural number, and 2n+12n+1 is exactly the next odd number in the sequence above. A direct consequence is that between n2n^2 and (n+1)2(n+1)^2 there are exactly 2n2n numbers, none of which is a perfect square (since consecutive squares are 2n+12n+1 apart, one of those 2n+12n+1 integers is n2n^2 itself, leaving 2n2n non-square numbers before you reach (n+1)2(n+1)^2). One more useful pattern comes from consecutive even or odd numbers: (a+1)(a−1)=a2−1(a+1)(a-1) = a^2-1, which is how 11×1311\times13 becomes 122−1=14312^2-1=143 without direct multiplication.

Figure
A four by four grid of unit squares coloured in four L shaped layers showing that one plus three plus five plus seven equals sixteen
Squares are built from odd-number gnomons Each L-shaped layer adds the next odd number to make the next bigger square layer 1: adds 1, running total 1 = 1 squared layer 2: adds 3, running total 4 = 2 squared layer 3: adds 5, running total 9 = 3 squared layer 4: adds 7, running total 16 = 4 squared 1 + 3 + 5 + 7 = 16 Each new gnomon (L shaped border) is exactly the next odd number

Squares without multiplying

Squaring a two-digit number by long multiplication is slow, but the distributive law shortens it. Write the number as a sum of a round part and a units part, x=a+bx=a+b, and expand:

(a+b)2=a(a+b)+b(a+b)=a2+2ab+b2.(4)(a+b)^2 = a(a+b) + b(a+b) = a^2 + 2ab + b^2. \qquad (4)

where: aa is usually the tens (or hundreds) part and bb the remaining part. For 4747, take a=40a=40, b=7b=7: 472=402+2(40)(7)+72=1600+560+49=220947^2 = 40^2 + 2(40)(7) + 7^2 = 1600+560+49=2209. Numbers ending in 55 have their own faster shortcut. Writing such a number as 10a+510a+5,

(10a+5)2=100a(a+1)+25,(5)(10a+5)^2 = 100a(a+1) + 25, \qquad (5)

where: aa is the number formed by all digits except the final 55. So 65265^2: here a=6a=6, giving 100(6)(7)+25=4200+25=4225100(6)(7)+25=4200+25=4225.

Square roots: the inverse of squaring

Squaring turns a number into its square; a square root undoes that. If n2=mn^2=m, then nn is called a square root of mm. Every positive perfect square actually has two integer square roots — for instance 92=819^2=81 and also (−9)2=81(-9)^2=81, so both 99 and −9-9 are square roots of 8181. To avoid ambiguity, this chapter (and almost all of school mathematics) works only with the positive square root, called the principal square root, written with the radical symbol:

m=nmeansn2=m, n≥0.(6)\sqrt{m} = n \quad \text{means} \quad n^2 = m,\ n \geq 0. \qquad (6)

where: x\sqrt{\phantom{x}} always returns the non-negative root, so 81=9\sqrt{81}=9 (never −9-9), and 4=2\sqrt{4}=2, 100=10\sqrt{100}=10. Finding m\sqrt{m} by trial works for small perfect squares but becomes impractical for large ones, which is exactly why the chapter develops three systematic methods: repeated subtraction of consecutive odd numbers (reversing pattern (2) above), prime factorisation (pairing equal prime factors), and the long-division method, proved in the first derivation below.

Figure
A number line from 9 to 36 marking the perfect squares three squared four squared five squared and six squared with the non square numbers between them counted as six eight and ten
How many numbers lie between consecutive squares 9 = 3 squared 16 = 4 squared 25 = 5 squared 36 = 6 squared 6 numbers = 2 times 3 8 numbers = 2 times 4 10 numbers = 2 times 5 Between n squared and (n+1) squared there are always exactly 2n non-square numbers

Pythagorean triplets

A Pythagorean triplet is a set of three natural numbers a,b,ca, b, c satisfying a2+b2=c2a^2+b^2=c^2 — the relationship you already know from the Pythagoras theorem, where cc is the hypotenuse of a right triangle. The smallest example is 3,4,53, 4, 5, since 32+42=9+16=25=523^2+4^2=9+16=25=5^2; scaling it up gives more, like 6,8,106, 8, 10. A general formula generates infinitely many triplets from a single choice of natural number m>1m>1:

2m,m2−1,m2+1form a Pythagorean triplet.(7)2m,\quad m^2-1,\quad m^2+1 \qquad \text{form a Pythagorean triplet}. \qquad (7)

where: mm can be any natural number greater than 11; the derivation below proves this always works. Taking m=2m=2 gives 4,3,54, 3, 5; taking m=6m=6 gives 12,35,3712, 35, 37. Not every triplet arises this way for every choice of which number you fix — the second worked example below shows how to search for the right mm.

Two proofs behind the machinery

Derivation AThe algebra behind the long-division square-root method

The long-division method for square roots can feel like a magic recipe — double the quotient, guess a digit, multiply, subtract — with no obvious reason why it works. The goal of this derivation is to show that every step of the algorithm is nothing more than the algebraic expansion of (10a+b)2(10a+b)^2 applied one digit-pair at a time, so that the "double the quotient and append a digit" instruction is revealed to be exactly the coefficient 20a20a that appears when you expand a two-part square, and the method generalises to any number of digits by repeating the same idea on progressively larger blocks.

Step 1. Suppose the square root of NN has two digits, a tens digit aa and a units digit bb, so that N=10a+b\sqrt{N} = 10a+b and therefore N=(10a+b)2N=(10a+b)^2. Expand this using identity (4): N=100a2+20ab+b2=100a2+b(20a+b)N = 100a^2 + 20ab + b^2 = 100a^2 + b(20a+b). This single algebraic fact is the entire secret of the method.

Step 2. Bars are placed over pairs of digits from the right, which splits NN into a leftmost group (worth hundreds and above) and a rightmost pair. The leftmost group must be at least 100a2100a^2 divided out appropriately, so the first quotient digit aa is chosen as the largest number whose square does not exceed the leftmost group — this is exactly finding aa from the 100a2100a^2 term in the expansion.

Step 3. Subtracting a2a^2 from the leftmost group and bringing down the next pair of digits produces a new dividend equal to b(20a+b)b(20a+b), by Step 1. The algorithm now doubles the quotient found so far (giving 20a20a, since the quotient aa sits in the tens place, so doubling it and shifting gives 2×10a=20a2\times10a=20a), writes a blank for the new digit, and searches for the largest bb such that (20a+b)×b(20a+b)\times b does not exceed the new dividend — which is precisely solving b(20a+b)≤remainderb(20a+b) \leq \text{remainder}, the second half of the expansion in Step 1.

Step 4. Check this against 529\sqrt{529}. Here N=529N=529, and the leftmost bar covers 55, so a=2a=2 since 22=4≤5<32=92^2=4\leq5<3^2=9; the remainder is 529−400=129=b(40+b)529-400=129=b(40+b). Trying b=3b=3: 43×3=12943\times3=129, which matches exactly, giving 529=23\sqrt{529}=23. Because each new digit-pair is handled by re-applying Step 1 to the number found so far treated as the new "aa", the same expansion justifies the method for square roots of any number of digits, not just two. Verified: 232=52923^2 = 529 and 100(2)2+3(20×2+3)=400+129=529100(2)^2 + 3(20\times2+3) = 400+129 = 529, matching the direct computation.

Go deeper · Derivation B · 1 minProving that 2m, m squared minus 1, and m squared plus 1 form a Pythagorean triplet
Derivation BProving that 2m, m squared minus 1, and m squared plus 1 form a Pythagorean triplet

NCERT states, without proof, that for any natural number m>1m>1 the three numbers 2m2m, m2−1m^2-1 and m2+1m^2+1 always satisfy the Pythagoras relation. The goal here is to prove that claim completely using only algebraic expansion, so that the formula stops being a rule to memorise and becomes a fact you can rebuild from scratch whenever you need it, and so that you can see exactly why m2+1m^2+1 must always be the hypotenuse (the largest of the three).

Step 1. Write down what needs to be shown: that (2m)2+(m2−1)2(2m)^2 + (m^2-1)^2 equals (m2+1)2(m^2+1)^2 for every natural number m>1m>1. This is the Pythagoras condition a2+b2=c2a^2+b^2=c^2 with a=2ma=2m, b=m2−1b=m^2-1 and c=m2+1c=m^2+1.

Step 2. Expand the left-hand side term by term. First, (2m)2=4m2(2m)^2 = 4m^2. Second, using (x−1)2=x2−2x+1(x-1)^2=x^2-2x+1 with x=m2x=m^2, we get (m2−1)2=m4−2m2+1(m^2-1)^2 = m^4 - 2m^2 + 1.

Step 3. Add the two expansions from Step 2: 4m2+(m4−2m2+1)=m4+2m2+14m^2 + (m^4 - 2m^2 + 1) = m^4 + 2m^2 + 1, since 4m2−2m2=2m24m^2-2m^2=2m^2.

Step 4. Expand the right-hand side using (x+1)2=x2+2x+1(x+1)^2=x^2+2x+1 with x=m2x=m^2: (m2+1)2=m4+2m2+1(m^2+1)^2 = m^4+2m^2+1. This is identical to the result of Step 3, so (2m)2+(m2−1)2=(m2+1)2(2m)^2+(m^2-1)^2=(m^2+1)^2 for every mm, which proves the claim in full generality.

Step 5. Note the boundary case and a caveat. The condition m>1m>1 is needed only so that m2−1m^2-1 is a positive natural number (at m=1m=1, m2−1=0m^2-1=0, which is not a valid triplet member). Also, this formula generates infinitely many triplets but not every triplet — the well-known triplet 5,12,135, 12, 13 has 1212 as a member, yet 1212 cannot be reached as the "2m2m" part in a way that reproduces 55 and 1313 from a single consistent mm using this construction; it must be found by other means. Verified: for m=6m=6, 2m=122m=12, m2−1=35m^2-1=35, m2+1=37m^2+1=37, and 122+352=144+1225=1369=37212^2+35^2=144+1225=1369=37^2, confirming the identity numerically.

Worked examples

Board level - Squaring two numbers without direct multiplication

Find 47247^2 using the distributive method, and find 85285^2 using the shortcut for numbers ending in 55.

Step 1. For 47247^2, split 47=40+747 = 40+7 and apply identity (4): 472=402+2(40)(7)+7247^2 = 40^2 + 2(40)(7) + 7^2.

Step 2. Compute each piece: 402=160040^2=1600, 2(40)(7)=5602(40)(7)=560, 72=497^2=49. Adding: 1600+560+49=22091600+560+49=2209.

Step 3. For 85285^2, use the ending-in-55 shortcut from identity (5) with a=8a=8 (everything before the final 55): 852=100×8×9+25=7200+25=722585^2 = 100 \times 8 \times 9 + 25 = 7200+25=7225. Answer: 472=220947^2 = 2209 and 852=722585^2 = 7225.

Board level - Constructing a Pythagorean triplet with a given smallest member

Write a Pythagorean triplet whose smallest member is 1010.

Step 1. Use the general form (7): 2m2m, m2−1m^2-1, m2+1m^2+1. Since 1010 is meant to be the smallest member, try setting 2m=102m=10 first, because for m≥2m\geq2 the term m2−1m^2-1 tends to grow faster than 2m2m and is usually larger.

Step 2. From 2m=102m=10, m=5m=5. Then m2−1=25−1=24m^2-1 = 25-1=24 and m2+1=25+1=26m^2+1=25+1=26.

Step 3. Check the ordering: the three numbers are 10,24,2610, 24, 26, and indeed 1010 is the smallest. Verify: 102+242=100+576=676=26210^2+24^2 = 100+576=676=26^2. Answer: the triplet is 10,24,2610, 24, 26.

Higher-order thinking (HOTS / olympiad-style) - Combining prime factorisation, division method and the odd-square pattern

Find the smallest whole number by which 13231323 must be multiplied to get a perfect square. Find the square root of the resulting number by prime factorisation, verify it by the long-division method, and then use the pattern for squares of odd numbers to express that square root's square as the sum of two consecutive positive integers.

Step 1. Factorise 13231323 into primes: 1323=3×441=3×32×72=33×721323 = 3 \times 441 = 3 \times 3^2 \times 7^2 = 3^3 \times 7^2. The factor 33 appears three times (an odd count, unpaired) while 77 appears twice (already paired).

Step 2. To make every prime occur an even number of times, one more factor of 33 is needed: 1323×3=34×72=39691323 \times 3 = 3^4 \times 7^2 = 3969. So the smallest multiplier is 33, and 39693969 is a perfect square, with 3969=32×7=9×7=63\sqrt{3969} = 3^2 \times 7 = 9\times7=63 by pairing.

Step 3. Verify by long division: bar 39693969 as 39 6939\ 69. The largest number whose square does not exceed 3939 is 66 (since 62=366^2=36), leaving remainder 33; bring down 6969 to get 369369. Doubling the quotient gives 12_12\_, and testing digit 33: 123×3=369123\times3=369, matching exactly with zero remainder. The quotient is 6363, confirming 3969=63\sqrt{3969}=63.

Step 4. Since 6363 is odd, apply the consecutive-integers pattern for odd squares: 632=632−12+632+12=39682+39702=1984+198563^2 = \dfrac{63^2-1}{2} + \dfrac{63^2+1}{2} = \dfrac{3968}{2}+\dfrac{3970}{2} = 1984+1985. Check: 1984+1985=39691984+1985=3969, matching. Answer: the smallest multiplier is 33, the new number is 39693969, and 3969=63=1984+1985\sqrt{3969}=63=1984+1985. Timing note: allow three to four minutes. The chain is factorise, spot the unpaired prime, multiply to pair it, read the root off the paired factors, then cross-check with one full long-division pass. The final consecutive-integers step is a quick multiply-and-halve, not a new computation — reuse the 632=396963^2=3969 value you already found rather than recomputing it.

Common traps

  • Flipping the digit-ending rule. Ending in 0,1,4,5,60, 1, 4, 5, 6 or 99 is necessary but never sufficient — always check further (see the misconception box below).
  • Forgetting to pair every prime factor. A perfect square needs every prime's count even; one unpaired factor gives a wrong "yes."
  • Losing the bar direction on decimals. Integer-part bars move left from the units digit; decimal-part bars move right from the decimal point — mixing these up misplaces the decimal in the answer.
  • Assuming the negative square root is wrong. x\sqrt{\phantom{x}} names only the positive root by convention; write 81=9\sqrt{81}=9, not ±9\pm9, unless solving an equation.
  • Treating 2m,m2−1,m2+12m, m^2-1, m^2+1 as the only source of triplets. It generates infinitely many, but not all (for example 5,12,135, 12, 13).
  • Miscounting bars for large numbers. Six digits means three bars means a three-digit root; an odd total leaves one leftover digit on the far left.

You should be able to…

  • Define a perfect square and check, by comparing to nearby squares, whether a given small number is one.
  • State and use the units-digit rule to instantly reject numbers that cannot be perfect squares.
  • Explain why perfect squares must have an even number of trailing zeros.
  • Use the sum-of-odd-numbers pattern to test whether a number is a perfect square by repeated subtraction.
  • Find how many non-square numbers lie between any two consecutive perfect squares using 2n2n.
  • Square any two-digit or three-digit number without long multiplication, using the distributive expansion or the ending-in-5 shortcut.
  • Generate a Pythagorean triplet from a chosen natural number mm using 2m,m2−1,m2+12m, m^2-1, m^2+1, and verify it satisfies a2+b2=c2a^2+b^2=c^2.
  • Find the square root of a perfect square by prime factorisation, pairing equal factors correctly.
  • Find the square root of any number, including decimals, using the long-division method, placing bars correctly in both directions.
  • Solve applied problems (areas, rows-and-columns, smallest multiplier or divisor to reach a perfect square) by translating them into a square-root computation.

Ask the tutor: Want to work through a few more long-division square roots together, or try building your own Pythagorean triplets from different values of m?

Why do we only take the positive square root when negative numbers also square to give the same answer

Both are genuine mathematical square roots — for example 92=819^2=81 and (−9)2=81(-9)^2=81, so 8181 truly has two square roots, 99 and −9-9. But the radical symbol x\sqrt{\phantom{x}} is defined by convention to name only the non-negative one, called the principal square root. This keeps x\sqrt{\phantom{x}} behaving as a single, predictable function rather than something that gives two different answers every time. In Class 8, unless a question specifically asks for "all square roots" or is solving an equation like x2=81x^2=81, always report 81=9\sqrt{81}=9, not −9-9 and not both.

How can I quickly tell that a number cannot possibly be a perfect square without doing any calculation

Two fast checks cover most cases. First, look at the units digit: if it is 2,3,72, 3, 7 or 88, the number is immediately ruled out, since no perfect square ever ends in those digits. Second, count the trailing zeros: a perfect square must have an even number of zeros at its end, so a number like 6400064000 (three zeros) or 222000222000 (three zeros) cannot be a perfect square. Neither check can confirm that a number is a perfect square, only rule some numbers out instantly — for that final confirmation you still need factorisation or the division method.

In the long division method how do I know in advance how many digits the answer will have

Count how many bars you can place over the number, pairing digits from the units place outward (and leaving a single leftover digit on the far left if the total count is odd). Each bar produces exactly one digit of the square root. So a four-digit or three-digit perfect square (two bars) has a two-digit square root, while a six-digit perfect square (three bars) has a three-digit root. You can do this bar-count before starting any division, purely by looking at how many digits the number has.

Does the formula 2m, m squared minus 1, m squared plus 1 give every possible Pythagorean triplet

No, and this is explicitly worth remembering. The formula generates infinitely many valid triplets — pick any natural number m>1m>1 and it always works, as proved in the second derivation above. But it does not reach every triplet. The triplet 5,12,135, 12, 13 is a genuine Pythagorean triplet (52+122=25+144=169=1325^2+12^2=25+144=169=13^2), and 1212 also happens to be a member of the triplet 12,35,3712, 35, 37 generated by m=6m=6 — yet 5,12,135, 12, 13 itself cannot be produced from this formula with one consistent value of mm. So use the formula to generate triplets freely, but do not assume a triplet must fit this pattern to be valid.

Before this

Where this leads