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

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

Square numbers 1 4 and 9

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:

growing the square numbers

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 Madness

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:


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

  1. Rethinking Arithmetic: A Visual Guide
  2. Learning How to Count (Avoiding The Fencepost Problem)
  3. Techniques for Adding the Numbers 1 to 100
  4. Surprising Patterns in the Square Numbers (1, 4, 9, 16…)
  5. A Quirky Introduction To Number Systems
  6. Another Look at Prime Numbers
  7. Fun With Modular Arithmetic

Questions & Contributions


  1. 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.

  2. @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!

  3. 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.

  4. 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!

  5. @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.

  6. 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).

  7. 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.

  8. @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!).

  9. @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.

  10. 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.

  11. 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

  12. 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?

  13. @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!

  14. 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.

    Muhammad Faisal

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

  16. 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

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

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

  19. 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.

  20. @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.

  21. 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.

  22. 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.

  23. @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).

  24. @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 :).

  25. 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

  26. 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

  27. 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
    recognize the pattern?

  28. 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.

  29. 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

  30. 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

    ∑v Xn^(X-v)

    This works out for a 2 dimensional object as

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

    (hence 2n+1)

    This works out for a 3 dimensional object as

    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
    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)

  31. 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
    Sry for my bad English 😀

  32. 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

  33. 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.

  34. 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

  35. 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

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

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

  38. I really enjoyed this article; well done!

    Something my math teacher showed me:

    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

  39. 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

  40. 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?

  41. 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

  42. 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

  43. 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.

  44. You might add something on percents, fractions and ratios. My daughter always had trouble. What was obvious to me was not to her. She needed a more visual approach. Such things as (but not limited to):
    percents to/from fractions and decimal numbers
    30% discount followed by a 20% discount on $100 is $56 not $50.
    Doing the above problem as $100 * .7 * .8 = $56
    A 50% decrease followed by a 50% increase yields 75% of the original value.
    Adding and multiplying fractions

  45. if x,y,z are three successive numbers then,the cube of the middle number (y) is related to its neighbours as,



  46. yes COLIN……..i have noticed that….

    moreover the sum digits in the difference between any two successive cube will
    EITHER ‘1’ OR ‘7’..

  47. Delighted to have come across this article and interesting comments.
    My 3rd grader just recently figured out the difference to the next square, which he thought of as n + (n +1), and I worked it out algebraically with him to show that it works for all cases. He will love the related observations above (though the calculus section will wait for another day :-) ).

  48. Dear Kalid,
    Great job Sir!
    Your posts have had a great impact on the way I looked at Mathematics.
    I thought math was just about remembering theorems and applying them in Problems and frankly speaking, the education system in India forced me to believe the same.
    A genuine thanks!

  49. I’ve also discovered that if you take the d, +1 and divided by 2, you find the square root. So if 64 has a d of 15, 15+1=16 and 16/2= 8. Also, any d with 9 as second value (d=9 or d=19) is a multiple of 5. Therefore if you have something like 9025, you can x the difference between the difference and add 50 and you find 189d is = to 9025. Therefore, 189+1/2 = 95.
    The equation is simplified to sqr=d+1/2

  50. Can you help me with this? There is a pattern between these numbers but I can’t seem to find it.

  51. @Cassidy
    There’s no immediate pattern unless 4, should in fact be 15.
    Then it would simply be n*3+3 or (n+1)*3.

  52. @Sol Lederman (post #15 … is almost 5 years old, but I saw it today … :-) ) wrote: “… A great follow up article would be to show how the sums of cubes is related to the volume of a pyramid.”
    Maybe he meant: “… sum of squares …”, not “… the sum of cubes …”, because sum of squares (1 to n) is:
    n*(n+1)*(2n+1)/6, can be written as n*(n+1)*(n+1/2)/3 or n^3/3 + n^2/2 + n/6, so we may deduce that the volume of {cone or pyramid} might be: area_of_the_base * height /3 , and the sum of cubes is: (n*(n+1)/2)^2 =
    (sum_of_numbers_1_to_n)^2, and this would be a sqare of some (“triangular_like_shape”) area, which is a
    “hypervolume” of a 4_dimensional “object “…

  53. There are a lot of “problems above”, be more specific. For the sum of “n-th” powers of numbers 1 to “n” you do not need any program. I had learned that long before I learned to program in Basic, FORTRAN, Pascal, C, COBOL, PL/I … while Object Oriented Programming and C++ existed, but at universities … :-)

  54. …. so interesting…. Amazed that we can play with square numbers…. Soon i will find a new pattern and post. M working on that.Till then keep waiting……

  55. @Sean
    The thing about “as long as the number being squared is divisible by 3, that the sum of the numbers in the answer of the square is equal to 9” isn’t true for (3^20) even though that number is divisible by 3 and it’s square root is a whole number. The digits of 59049 don’t add up to 9!

  56. @Chris Nash
    [comment #28, #29, #98]
    The “trick” still holds for 3^10 being divisible by 3 and therefore (3^10)^2 = 3^20 being divisible by 9.

    The idea is that the sum of the digits of 3^10 (=59,049 -> 5+9+0+4+9=27) is divisible by 3, while the sum of the digits of 3^20 (=3,486,784,401 -> 3+4+8+6+7+8+4+4+0+1=45) is divisible by 9.
    Note that 3^10 was divisible by 9 in the first place, but even if it was only divisible by 3 (and not by 9), its square would be divisible by 9.

  57. I’ve seen this before, commenting on the “2n+1” beginning part. This is pretty obvious because 2n+1 would be the difference from n^2 and (n+1)^2 so n^2+2n+1 would be the next square. You could’ve done (n+1)^2 and just got those values, which equates to a quadratic function.

Your feedback is welcome -- leave a reply!

Your email address will not be published.

LaTeX: $ $e=mc^2$$