# Surprising Patterns in the Square Numbers (1, 4, 9, 16…)

Get the Math, Better Explained eBook and turn Huh? to Aha!

A quick puzzle for you — look at the first few square numbers:

1, 4, 9, 16, 25, 36, 49…

And now find the difference between consecutive squares:

1 to 4   = 3
4 to 9   = 5
9 to 16  = 7
16 to 25 = 9
25 to 36 = 11
…


Huh? The odd numbers are sandwiched between the squares?

Strange, but true. Take some time to figure out why — even better, find a reason that would work on a nine-year-old. Go on, I’ll be here.

## Exploring Patterns

We can explain this pattern in a few ways. But the goal is to find a convincing explanation, where we slap our forehands with “ah, that’s why!”. Let’s jump into three explanations, starting with the most intuitive, and see how they help explain the others.

## Geometer’s Delight

It’s easy to forget that square numbers are, well… square! Try drawing them with pebbles

Notice anything? How do we get from one square number to the next? Well, we pull out each side (right and bottom) and fill in the corner:

While at 4 (2×2), we can jump to 9 (3×3) with an extension: we add 2 (right) + 2 (bottom) + 1 (corner) = 5. And yep, 2×2 + 5 = 3×3. And when we’re at 3, we get to the next square by pulling out the sides and filling in the corner: Indeed, 3×3 + 3 + 3 + 1 = 16.

Each time, the change is 2 more than before, since we have another side in each direction (right and bottom).

Another neat property: the jump to the next square is always odd since we change by “2n + 1″ (2n must be even, so 2n + 1 is odd). Because the change is odd, it means the squares must cycle even, odd, even, odd…

And wait! That makes sense because the integers themselves cycle even, odd, even odd… after all, a square keeps the “evenness” of the root number (even * even = even, odd * odd = odd).

Funny how much insight is hiding inside a simple pattern. (I call this technique “geometry” but that’s probably not correct — it’s just visualizing numbers).

## An Algebraist’s Epiphany

Drawing squares with pebbles? What is this, ancient Greece? No, the modern student might argue this:

• We have two consecutive numbers, n and (n+1)
• Their squares are n2 and (n+1)2
• The difference is (n+1)2 – n2 = (n2+ 2n + 1) – n2 = 2n + 1

For example, if n=2, then n2=4. And the difference to the next square is thus (2n + 1) = 5.

Indeed, we found the same geometric formula. But is an algebraic manipulation satisfying? To me, it’s a bit sterile and doesn’t have that same “aha!” forehead slap. But, it’s another tool, and when we combine it with the geometry the insight gets deeper.

Calculus students may think: “Dear fellows, we’re examining the curious sequence of the squares, f(x) = x^2. The derivative shall reveal the difference between successive elements”.

And deriving f(x) = x^2 we get:

$\displaystyle{\frac{d}{dx}x^{2}=2x}$

Close, but not quite! Where is the missing +1?

Let’s step back. Calculus explores smooth, continuous changes — not the “jumpy” sequence we’ve taken from 22 to 32 (how’d we skip from 2 to 3 without visiting 2.5 or 2.00001 first?).

But don’t lose hope. Calculus has algebraic roots, and the +1 is hidden. Let’s dust off the definition of the derivative:

$\displaystyle{f'(x)=\lim_{dx\to 0}{f(x+dx)-f(x)\over dx}}$

Forget about the limits for now — focus on what it means (the feeling, the love, the connection!). The derivative is telling us “compare the before and after, and divide by the change you put in”. If we compare the “before and after” for f(x) = x^2, and call our change “dx” we get:

$\displaystyle{\frac{(x+dx)^2 - x^2}{dx} = \frac{(x^2+2x \cdot dx + dx^2) - x^2}{dx} = \frac{2x \cdot dx + dx^2}{dx}}$

$\displaystyle{= 2x + dx}$

Now we’re getting somewhere. The derivative is deep, but focus on the big picture — it’s telling us the “bang for the buck” when we change our position from “x” to “x + dx”. For each unit of “dx” we go, our result will change by 2x + dx.

For example, if we pick a “dx” of 1 (like moving from 3 to 4), the derivative says “Ok, for every unit you go, the output changes by 2x + dx (2x + 1, in this case), where x is your original starting position and dx is the total amount you moved”. Let’s try it out:

Going from 32 to 42 would mean:

• x = 3, dx = 1
• change per unit input: 2x + dx = 6 + 1 = 7
• amount of change: dx = 1
• expected change: 7 * 1 = 7
• actual change: 42 – 32 = 16 – 9 = 7

We predicted a change of 7, and got a change of 7 — it worked! And we can change “dx” as much as we like. Let’s jump from 32 to 52:

• x = 3, dx = 2
• change per unit input: 2x + dx = 6 + 2 = 8
• number of changes: dx = 2
• total expected change: 8 * 2 = 16
• actual change: 52 – 32 = 25 – 9 = 16

Whoa! The equation worked (I was surprised too). Not only can we jump a boring “+1″ from 32 to 42, we could even go from 32 to 102 if we wanted!

Sure, we could have figured that out with algebra — but with our calculus hat, we started thinking about arbitrary amounts of change, not just +1. We took our rate and scaled it out, just like distance = rate * time (going 50mph doesn’t mean you can only travel for 1 hour, right? Why should 2x + dx only apply for one interval?).

My pedant-o-meter is buzzing, so remember the giant caveat: Calculus is about the micro scale. The derivative “wants” us to explore changes that happen over tiny intervals (we went from 3 to 4 without visiting 3.000000001 first!). But don’t be bullied — we got the idea of exploring an arbitrary interval “dx”, and dagnabbit, we ran with it. We’ll save tiny increments for another day.

## Lessons Learned

Exploring the squares gave me several insights:

• Seemingly simple patterns (1, 4, 9, 16…) can be examined with several tools, to get new insights for each. I had completely forgotten that the ideas behind calculus (x going to x + dx) could help investigate discrete sequences.
• It’s all too easy to sandbox a mathematical tool, like geometry, and think it can’t shed light into higher levels (the geometric pictures really help the algebra, especially the +1, pop). Even with calculus, we’re used to relegating it to tiny changes — why not let dx stay large?
• Analogies work on multiple levels. It’s clear that the squares and the odds are intertwined — starting with one set, you can figure out the other. Calculus expands this relationship, letting us jump back and forth between the integral and derivative.

As we learn new techniques, don’t forget to apply them to the lessons of old. Happy math.

## Appendix: The Cubes!

I can’t help myself: we studied the squares, now how about the cubes?

1, 8, 27, 64…

How do they change? Imagine growing a cube (made of pebbles!) to a larger and larger size — how does the volume change?

## Other Posts In This Series

Kalid Azad loves sharing Aha! moments. BetterExplained is dedicated to learning with intuition, not memorization, and is honored to serve 250k readers monthly.

Math, Better Explained is a highly-regarded Amazon bestseller. This 12-part book explains math essentials in a friendly, intuitive manner.

"If 6 stars were an option I'd give 6 stars." -- read more reviews

1. Jeff says:

cubes: 3x^2+3x+1

2. Dave says:

Jeff has posted the green part (distance to the next cube). Don’t forget the original x^3 (the blue part).

So (x+1)^3 = x^3 + 3x^2 + 3x + 1

You can use Pascal’s triangle or the binomial theorem to get the result for (x+1)^4, but at that point I usually stop using pebbles.

3. Duncan says:

What software did you use to draw the pebbles?

4. going from 3 square to 6 square
x=3 dx=3
(2x + dx)*x = (2*3 + 3) * 3 = 27
36-9=27
.. whoa it works

5. hitoshi says:

Nice!
Geometric explanation is intuitive. I also like the Calculus method. Thanks!

6. Harish Dobhal says:

Brilliant!

7. Kalid says:

@Jeff, Dave: Right on. I like to visual 3 flat panels, 3 gutters, and 1 corner piece to fill in the gap. Pascal’s Triangle is another great tool, would be fun as another post!

@Duncan: I used PowerPoint 2007, my secret weapon

@Akshay: Surprising, right?

@Harash, @hitoshi: Glad you liked it!

8. Sahil says:

Nice article. That geometric approach though is taught to high-school students, I think.

Also,I’ve left you a message that kinda pertains to this topic, so you might wanna check it. It’s a pattern of squares. Original research, but it works and that’s all that matters. One spoonful of free pie too.

But no seriously, check it out.

9. Wow, another nice article. I love your thinking, I love the geometric consideration, as my Maths teachers says every time: “Don’t forget mathematics started with geometry”.
Keep posting!

10. Kalid says:

@Sahil: Thanks, I got your message, really interesting patterns in there.

11. Kalid says:

@nschoe: Thanks for the support :). Totally agree with your math teacher, we can often learn so much by drawing a simple diagram instead of doing everything in algebra.

12. Joe says:

The first thing I thought of was that squaring a number keeps, like you said, its “evenness” of the number. Also, subtracting an even and odd (or odd and even) produces an odd.

And since each number alternates between even and odd and your taking its square to keep its evenness, the difference stays odd.

This works without a power of 1 as well, but the difference between consecutive numbers will always be “1″ (an odd).

13. Kalid says:

@Joe: Ah, interesting insight on the subtraction!

14. ne_akari says:

A^2-B^2 = (A+B)*(A-B).
when A-B =1,A^2-B^2 = A+B = 2A-1 = 2B+1.

15. Nice and “better explained” than I’ve seen in other places.

A great follow up article would be to show how the sums of cubes is related to the volume of a pyramid. Perhaps even a separate article on how to derive the formula for the volume of a pyramid without using calculus.

16. Kalid says:

@ne_akari: I like the manipulation — either twice the current plus 1, or twice the next minus 1.

@Sol: Thanks for dropping by! A cube article could be fun, I like these geometric manipulations (they feel more like play than work!).

17. Wow , thank you very Khalid for all your articles , I am learning a lot from you .

Keep up the good work

18. Kalid says:

@Seifeddine: Thanks for the encouragement!

19. ash says:

fun! i felt like a kid thinking about these things.

20. Hey , I think I found something strange , (8*8) – (7*7) = 15 which is not a prime number , obviously.

21. @ash: Thanks for dropping by :). Yeah, when math is more about exploration / puzzle solving it can be pretty fun.

@Seifeddine: Ah, actually the differences just need to be odd (2n + 1), not prime.

22. Shame on me , I should have read your article more carefully .

23. Nayan Shah says:

Wonderful approaches to regular problems.

24. Anonymous says:

I have a neat problem:
Suppose that we extend definitions of evenness and oddness to the entire set of real numbers by the following:
The set of odd numbers is exactly the set of all differences (n+1)^a-n^a for positive rational a and integral n.
A number is even iff it is twice an odd number.
All other real numbers are neither even nor odd.

Is the set of even numbers still disjoint from the set of odd numbers? (i.e. is an odd number twice another odd number?)

Prove that the set of real numbers neither even nor odd has the same cardinality as the set of real numbers.

25. Amazing job of finding these patterns. I know finding patterns was an easy way for me to learn mathmatics when I was younger.

26. Kalid says:

@Tracy: Thanks! Yes, I think the heart (and fun) of math is really about finding and describing patterns.

27. Joy says:

really awesome insights into difference of squares but the main place this seems to apply is summations of Squares, how would you connect 2n+1 to n/6(n+1)(2n+1) i can see the 2n+1 in the formula but the n/6(n+1) part still doesn’t make sense to me

28. I like the posts on this. Am wondering if anyone can help my daughter and I figure out how to validate the pattern that we found in our squares. We found that, as long as the number beig squared is divisible by 3, that the sum of the numbers in the answer of the square is equal to 9. For example, 3 sq is divisible by 3 and the total of the answer (9) = 9. If we move onto 6 sq (also divisible by 3), the answer (36) = 9. And so on and so on….can anyone help explain this pattern to us?

29. Kalid says:

@Sean: Great question. It turns out that if the sum of the digits of a number add up to 9 (or a multiple of 9, like 18, etc.) then that number is divisible by nine.

if the number being squared is divisible by 3 (so it’s 3*n), then the square is (9 * n^2) which is divisible by 9, and therefore falls into the pattern :). I’d like to do a post on why the digits need to add up this way, but here’s one insight:

If we start with 9, clearly the digits (the only digit!) adds to 9. Whenever we add 9, we’re really doing (10 – 1) which means “increase the tens digit by 1, and decrease the ones digit by 1″. This keeps the sum of digits in balance, so we should expect that the sum of digits always equals 9 as before. (For example, 18 means we changed 09 to 18). Of course, once you get to 90 and add (10-1) you are really only able to “fill” the ones digit and get 99 (which then increases the total sum to 18 — but, you kept the sum of digits divisible by 9). Hope this helps!

30. kelly says:

ur website is sooo awesome i never get maths question but now i do thanks

31. Kalid says:

My question is that i don’t enough knowledge aboout even and odd number. Tells me that some examples and also difinitions of both numbers.

Thanks

33. Anonymous says:

I was really surprised by the calculus method. It is cool.

34. Anonymous says:

Wo! really fantastic

35. Anonymous says:

i didnt like it

36. pinky says:

really , good.

37. S.NITHEESKUMAR says:

i am for square patterns like[25sq=625={2*3}hundreds+25

BY,
S.NITHEESH KUMAR

38. harsha bhogle says:

very iteresting
lurved it!!!!!!!!!!!!!

39. sap says:

can we get any multiplication square patterns?????????i have not found any one!!!!!!!!!!!1foolish thing

40. Kalid says:

@harsha: Thanks!

41. kaily says:

Good way to look at squared numbers with the pebbles. I never knew there was so much to sqaured numbers

42. Melissa says:

wow, this is great ! I have never heard of some of these methods and all the different things you can do with calculus concerning patterns :O

43. Melissa B says:

I never thought about using it with pebbles either it makes things so much clearer! Really interesting

44. kalid says:

@kaily: Thanks, glad it was useful to you!

45. kalid says:

@Melissa: Awesome, happy you enjoyed it!

46. kalid says:

@Melissa: Thanks, I love it when counting can become fun :). I find it can help to visualize math with real-world objects.

47. crossbow says:

Hi Kalid ,

I am preparing for a quantitative aptitude test and I always had the feeling of not having an aptitude for maths.After reading your blog, am feeling a little confident.Please give some insight on how to prepare for quantitative maths as I failed in my previous attempt for the above mentioned test.

48. kalid says:

@crossbow: Hi, my general advice would be to make sure you have an intuition for the concepts you have to learn, and then test your intuition by doing practice problems. Doing problems by themselves will only give you a mechanical understanding. It’s a very general question, but really try to develop your intuition for each topic as they come up. Good luck.

49. Jenn says:

To think about the cube method geometrically, I came up with the formula (x+1)^3 + x(2x+1).
(x+1)^3 represents the new top layer of the growing cube (assuming you are building up).
2x+1 is the new “thickness” around each of the existing layers. It is the same concept as you used for the growth of the area in the square example. There would be x layers where this new “thickness” is needed.
If you simplify (x+1)^3 +x(2x+1) it is equal to 3x^2+3x+1 which is the result when working with algebra or calculus.

I am interested if this is the way that other people thought of it, or if you set up a formula for geometric growth in a different way.

I really enjoyed the geometric, algebraic, and calculus connections in this post, but I agree that the geometric one is definitely the most intuitive, at least up to three dimensions.

50. John says:

I actually found the algebraic pattern one day while entertaining myself in a boring math lecture, and my mind almost exploded with excitement, except I did it a little bit differently.

although it is the same thing as x²+2x+1=(x+1)² I decided to give both numbers a variable, a and b, where b=a+1.
then it looks like a²+a+b=b²
ex 5²+5+6=36.

it seems more intuitive to me that instead of 2x+1, I saw it as a+b, and that the next number to be squared was already in the equation somewhere.

51. kalid says:

@John: Great explanation, I love seeing how other people think about it. I can already see the “a + b” version in my head, seeing how each side is growing (and one side is 1 unit longer than the other).

52. nelson says:

this works too!
[x+(x-1)]+(x-1)²
i figured that out and i am in the 10th grade!

53. kalid says:

@nelson: Awesome! In your case, it seems like x is the new number and x-1 is your original — another way to think about it :).

54. Hitanshu says:

it can be solved wid sequence nd series as well………

55. Levi Keller says:

As far as the cubes go (as well as higher dimensions) take the series 1,8,27,64,125…
take the differences (7,19,37,61) take the differences again (12,18,24..) take the differences again (6,6…) and notice that you have 3! (just as you had 2! with the squares).

raise to the fourth power, and you will have to take the differences of one more generation before you end up with 24 or 4!

The pattern continues thus…

I discovered this when I was bored in shul one shabbos, and I had to sneak into a backroom to use a pen

56. levi keller says:

In the case of the cube, you can see growth the of x^3 geometrically as extending by x^2 on three sides then 3x fills all the rest of the space except for one corner. This matches up with the algebraic expansion of (x+1)^3 = x^3 + 3x^2 + 3x + 1.
Its a bit harder to visualize in four dimensions, but you get the point

57. kalid says:

@levi: You got it! Tanks for sharing.

58. Popcorn lover says:

Hi
I <3 this site it's z bestest Eva eva Eva people should make more sites like dease

59. rick says:

write out all squares of 0-50 and you’ll notice the last two digits make a pattern
Look 0,1,4,9,16,25,36,49,64,81,100
Now counting down from 50 squared
2500,2401,2304,2209,2116,2025,1936,1849,1764,1681,1600
recognize the pattern?

60. this is the way that i made up
2 2 2 2
9 +(3+(9-1)x2)=10 or 10 + (3+(10-1)x2)=11 do you see the pattern

61. Cole says:

I found another instresting pattern I would like to show
1 1 after 0 +5
4 1 before 5 +5
9 1 before 10 +5
16 1 after 15 +10
25 On 25 +10
36 1 after 35 +15
49 1 before 50 +15
64 1 before 65 +15
Continue the same pattern, after before before after on, after before before after, on, forever and ever I found this pattern when playing with squares in my study hall. also it’s +5+5+5+10+10+15+15+15+20+20+25+25+25+30+30+35+35+35, ect.

62. Kousigan says:

Hi Kaled, Based on this same analogy I found a a-ha moment to describe (a+b)^2 = a^2 + b^2 + 2ab. Keep a square and b square next to each other. and we would need two rectangles (one horizontal and one vertical) with sides a and b to complete a+b square.. Thanks to you

63. kalid says:

@Kousigan: Nice analogy! I love seeing ways to visualize relationships.

64. Mike says:

Apologies if i’ve committed some heinous error below – it’s been some time since I had to use algebra but…..

given the obvious analogs between the cubes and the squares, could we generalise the result for an X-dimensional object?

Something like

0
∑v Xn^(X-v)
X-1

This works out for a 2 dimensional object as

v
0 = X*n^0 = 1
1 = X*n^1 = 2n

(hence 2n+1)

This works out for a 3 dimensional object as

v
0 = X*n^0 = 1
1 = X*n^1 = 3n
2 = X*n^2 = 3n^2

(hence 3n^2 + 3n + 1)

and for a 4 dimensional object we might then project this would be
v
0 = X*n^0 = 1
1 = X*n^1 = 4n
2 = X*n^2 = 4n^2
3 = X*n^3 = 4n^3

(hence 4n^3 + 4n^2 + 4n + 1)

65. Ahmed says:

I Have Been Thinking for that along time and Managed to find a relation from this relation that can get any Square Number
suppose we want to know 6^2 it will be equal to the distance from 1^2 to 6^2 + 1 so if we said x = 6 h = 6-1 = 5 there for 6^2 = 1 + h(2x+h) = 1 + 5 (2(1) + 5) = 36 so we can use this as a common formula for any number n^2 = 1+ h (2 + h) where h equals n-1 , and the same for cubes with the same method we can get a general formula which is 1+ h(3+3h+h^2) check for both it will work

66. Anonymous says:

i found another intresting pattern i would like to show
a) 3 squared =9
b) 10 squared=1oo
c) 4 squared=16
d) 9 squared=81
e) 6 squared=36
<3 i love maths =D

67. DJ1998 says:

Hey,
I figured that out myself though I really liked your visual tools.
You missed to write one thing though – The difference between 2 consecutive squares is odd and 2 consecutive differences are 2 consecutive odd numbers.
Helps in finding some squares.

68. JK says:

Not sure if this is common knowledge though discovered it for myself earlier and can’t find any similar representations but yours:
x^2 = (x-1)*(x+1)+1

and after a few more calculations discovered:
x^2 = (x-y)*(x+y)+y^2

Don’t know how much use this is to anyone but thought I’d share it all the same

69. vedant says:

hey,

if we add odd continously (consicutivly) the no. of odd numbers equal to the square root of the sum of the number
example – 1+3+5+7+9+11+13+15+17+19=100
squre root of 100 is equal to 10
= 1,3,5,7,9,11,13,15,17,19 are 10 numbers

70. vamica sachdev says:

awesome awesome awesome i just loved your square and square root patterns
and had a great help in my holidays homework…
THANKS A LOT!!!!

71. Waqar says:

I am looking for a specific pattern for squares of natural numbers
e.g, 4(power2)=1+2+3+4+3+2+1

72. Jeremy says:

Something my math teacher showed me:
1=1
3+5=8
7+9+11=27
13+15+17+19=64
21+23+25+27+29=125

In other words:
1st odd number=1^3
sum of next 2 odd numbers=2^3
sum of next 3 odd numbers=3^3
sum of next 4 odd numbers=4^3
…and so on.

I haven’t looked at this long enough to be able to say “I can’t figure out why it works,” but for now all I see is that:

the average of all of the numbers being summed = (# of numbers being summed)^2, and hence,

(the average of all of the numbers being summed)^(3/2)=the sum of the numbers

73. eYs says:

very interesting, thank you !

74. Mikhael says:

for some thing before i haven’t seen this site, i am expecting [(n-1)2]+1 to be seen

anyway, i used that formula (that i invented or discovered by myself if someone had it) to get the difference before

75. Eric V says:

Triangular numbers anyone?

It wasn’t ’till much later that I learned about triangular numbers and the ‘Handshake Problem’ but I most certainly remember experiencing my first triangular number. This gave me a great experience for the way math can teach us about growth and how deceptive our intuition can be without reasoned calculation.

One particular kenpo class our instructor had a great idea for sparring. Everyone lineup. The first student takes his turn:
-first student spars 2nd until 3 points are scored (everyone else do 10 pushups)
-regardless of winner 1st student spars 3rd student (drop & give me 10 everyone else)
-continue until the 1st student spars last student
Now the second student gets his turn.
Everyone gets a turn!

If memory serves there were 12 of us that day. Bonus question: How many sparring matches? How many push ups? At an average 3 minutes per sparring match (with 1 round of 10 pushups being completed sooner) how long were we there?

76. dyron says:

Thank you ,you help me a lots.I have stear on the web for thirty hours and still cannot think it instuitional.Could you tell me why the length of the arc equal to the”x” of e^xi ?forgive my Chinglish

77. dyron says:

HI,the words:
”We apply i units of growth in infinitely small increments, each pushing us at a 90-degree angle. There is no “faster and faster” rotation – instead, we crawl along the perimeter a distance of |i| = 1 (magnitude of i).”

I still cannot understand.If I think e^1 on the same way,then I get e^1=e(intuitively the length is e),but we get 1 radan(the length of arc is 1)from ‘e^i ‘.
best regard

78. kalid says:

Hi Dyron, great question (this is probably the wrong post though!).

When we have e^i, the base e is not the size or length: it’s the *type* of growth we have (growing continuously).

The exponent, i, has a size of 1, and modifies our growth to be a rotation. e^i is one radian around the circle, e^(2i) is 2 radians, and so on.

79. I can waiting for to the school