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.

Table of Contents

## 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 n
^{2}and (n+1)^{2} - The difference is (n+1)
^{2}– n^{2}= (n^{2}+ 2n + 1) – n^{2}= 2n + 1

For example, if n=2, then n^{2}=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 2^{2} to 3^{2} (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:

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:

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 3^{2} to 4^{2} 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: 4
^{2}– 3^{2}= 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 3^{2} to 5^{2}:

- 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: 5
^{2}– 3^{2}= 25 – 9 = 16

Whoa! The equation worked (I was surprised too). Not only can we jump a boring “+1″ from 3^{2} to 4^{2}, we could even go from 3^{2} to 10^{2} 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?

## Leave a Reply

125 Comments on "Surprising Patterns in the Square Numbers (1, 4, 9, 16…)"

cubes: 3x^2+3x+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.

What software did you use to draw the pebbles?

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

Nice!

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

Brilliant!

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

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.

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

fattttoooo

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!

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

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

@Joe: Ah, interesting insight on the subtraction!

A^2-B^2 = (A+B)*(A-B).

when A-B =1,A^2-B^2 = A+B = 2A-1 = 2B+1.

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.

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

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

Keep up the good work

@Seifeddine: Thanks for the encouragement! :)

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

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

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

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

Wonderful approaches to regular problems.

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.

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

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

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

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?

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

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

@Kelly: Awesome, glad it helped!