# A math curiosity

**URL:** <https://boards.straightdope.com/t/a-math-curiosity/783293>\
**Category:** Factual Questions\
**Created:** [March 29, 2017, 3:41pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293 "2017-03-29T15:41:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crane](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crane/32/3495_2.png) [@Crane](https://boards.straightdope.com/u/Crane)\
**Post date:** [March 29, 2017, 3:41pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/1 "2017-03-29T15:41:00Z")

</div>

Something that began while trying to return to sleep late at night:

The sum of sequential odd integers, beginning with 1, always results in an integer square.

A bit of addition shows that the sum of all (odd and even) sequential integers, only yields an integer square at the number 8: = 36 = 6^2, and not for numbers greater than 8.

Curious about this I wrote a quick routine and found a dozen more before my laptop ran out of floating point::

8: 36 = 6^2  
49: 1225 = 35^2  
288: 41616 = 204^2  
1681: 1413721 = 1189^2  
9800: 48024900 = 6930^2  
|  
|  
|  
207,878,255: 2.16\*10^16 = 146,992,124^2

At first I thought there would be a simple progression that would predict integer squares. On the first line 8\*36=288. That was encouraging, but doesn’t go anyplace. Also, there had to be an odd number between 8 and 288. I only found it with a program that examined all possible cases.

So, the question -\> is there an equation that predicts an integer square (N) that is the sum of all integers from 1 thru N?

Crane

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [March 29, 2017, 3:51pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/2 "2017-03-29T15:51:39Z")

</div>

Here’s the Online Encyclopedia of Integer Sequences entry for your sequence, which includes ways to generate it [A001108 - OEIS](https://oeis.org/A001108)

---

<div class="post-metadata">

**Author:** ![Crane](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crane/32/3495_2.png) [@Crane](https://boards.straightdope.com/u/Crane)\
**Post date:** [March 29, 2017, 4:00pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/3 "2017-03-29T16:00:26Z")

</div>

Andy,

Thanks - interesting site. I’ll plug in some numbers and try it.

Crane

---

<div class="post-metadata">

**Author:** ![74westy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/74westy/32/3950_2.png) [@74westy](https://boards.straightdope.com/u/74westy)\
**Post date:** [March 29, 2017, 4:25pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/4 "2017-03-29T16:25:00Z")

</div>

1 + 3 + 5 + … + 2k-1

add the sequence to itself in the opposite order

```auto

1 + 3 + 5 + ... + 2k-1 +
2k-1 + 2k-3 + 2k-5 + ... + 1 =
2k + 2k + 2k + ... + 2k

```

Now divide by 2 because you added the sequence to itself. Remember there are k terms. You get k[sup]2[/sup]

When I was young and agile of mind. I proved this to myself while lying in bed with my eyes closed after the sequence of integer squares was mentioned in an Arthur C. Clark book I was reading. I did it by induction that time so I wasn’t _that_ agile of mind.

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [March 29, 2017, 5:03pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/5 "2017-03-29T17:03:54Z")

</div>

> [@Andy\_L](#):
>
> Here’s the Online Encyclopedia of Integer Sequences entry for your sequence, which includes ways to generate it [A001108 - OEIS](https://oeis.org/A001108)

And when I look more closely, I see the generating formula is pretty easy

“a(n+1) = 6\*a(n)-a(n-1)+2, with a(0) = 0, a(1) = 1”

so a(2)=6_1-0+2=8 (as you have)  
a(3)=6_8-1+2=49 (as you have)  
a(4)=6\*49-8+2=288 (as you have) and so on.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [March 29, 2017, 6:44pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/6 "2017-03-29T18:44:03Z")

</div>

I just don’t follow the OP. 36 is the sum of the first 6 odd numbers. 1225 = 35^2 is the sum of the first 35 odd numbers. A nice geometric proof that the sum of the first n odd numbers is n^2 is to take an n x n square of dots, draw a box around the lower left 1 x 1 corner, then a box around the lower left 2 x 2 corner, whence you will see three dots in the space between the two boxes, then a box around the lower left 3 x 3 corner, leaving 5 dots between the last two boxes. The next box will add 7 dots and so on.

---

<div class="post-metadata">

**Author:** ![iamthewalrus\_3](https://avatars.discourse-cdn.com/v4/letter/i/258eb7/32.png) [@iamthewalrus\_3](https://boards.straightdope.com/u/iamthewalrus_3)\
**Post date:** [March 29, 2017, 7:06pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/7 "2017-03-29T19:06:09Z")

</div>

There’s also a nice inductive geometrical proof that the sum of odd integers makes a square.

If you have k[sup]2[/sup] squares of unit area arranged in a square, then add the next odd integer, you add k each to 2 edges, and one more to the corner.

For example, if k = 3, then you have 9 (I’ll use \*s because ascii art is hard):

* * *

* * *

* * *

Add 3 more to the top

* * *

* * *

* * *

* * *

Add 3 more to the Right

* * *

* * *

* * *

* * *

And add one more to the corner

* * *

* * *

* * *

* * *

Look, you added 2k+1 to a square, and got the next square.

ETA: Bah. Ninjaed because I took too long composing.

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [March 29, 2017, 7:10pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/8 "2017-03-29T19:10:30Z")

</div>

> [@Hari\_Seldon](#):
>
> I just don’t follow the OP. 36 is the sum of the first 6 odd numbers. 1225 = 35^2 is the sum of the first 35 odd numbers. A nice geometric proof that the sum of the first n odd numbers is n^2 is to take an n x n square of dots, draw a box around the lower left 1 x 1 corner, then a box around the lower left 2 x 2 corner, whence you will see three dots in the space between the two boxes, then a box around the lower left 3 x 3 corner, leaving 5 dots between the last two boxes. The next box will add 7 dots and so on.

The OP mentioned that he knew that the sum of first n odd integers (1, 3, 5 …) is always a perfect square - but his real question is about the sum of the first n integers (the triangular numbers). He found some examples where the sum of the first n integers (1, 2, 3, 4, …) was square (for example, the sum of the first 8 integers is 36, or 6 squared, and the sum of the first 49 integers is 1225, or 35 squared) and wondered what the pattern in those numbers were.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [March 29, 2017, 7:54pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/9 "2017-03-29T19:54:36Z")

</div>

Yes, and googling [square triangular numbers](https://www.google.com/#q=square+triangular+numbers) produces a number of sites about this phenomenon.

---

<div class="post-metadata">

**Author:** ![Crane](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crane/32/3495_2.png) [@Crane](https://boards.straightdope.com/u/Crane)\
**Post date:** [March 29, 2017, 8:10pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/10 "2017-03-29T20:10:31Z")

</div>

Andy,

Thanks for the clarification. I got confused by the notation…a(n-1) refers to the table contents.

Now it works.

Thanks again,

Crane

---

<div class="post-metadata">

**Author:** ![Crane](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crane/32/3495_2.png) [@Crane](https://boards.straightdope.com/u/Crane)\
**Post date:** [March 29, 2017, 8:18pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/11 "2017-03-29T20:18:37Z")

</div>

Hari#6,

Sorry I was not clear. As Andy points out, it’s the sum of the sequential integers.

Sum of odd integers 1 thru X =((X+1)/2)^2  
Sum of even integers 2 thru X=((X^2)/4) + X/2  
Sum of all integers 1 thru X=(X + X^2) / 2

Crane

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [March 29, 2017, 11:43pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/12 "2017-03-29T23:43:29Z")

</div>

[A001109 - OEIS](https://oeis.org/A001109) mentions much about these numbers.

> [@Crane](#):
>
> [1:1 = 1^2]  
> 8: 36 = 6^2  
> 49: 1225 = 35^2  
> 288: 41616 = 204^2  
> 1681: 1413721 = 1189^2  
> 9800: 48024900 = 6930^2

The circle inscribed in a 3-4-5 triangle has radius 1.  
The circle inscribed in a 20-21-29 triangle has radius 6. (20_21/(20+21+29))  
The circle inscribed in a 119-120-169 triangle has radius 35. (119_120/(119+120+169))  
… and so on. The A001109 numbers are the in-radii of the Pythagorean triangles whose sides are consecutive integers.

In the continued-fraction form of 3+√8 = … 4 \1+1 \1+4 \1+1 \1+4 \1+1 \1+5 — (I’ve used the convenient “reverse-division” notation) — the upper approximants (6/1, 35/6, 204/35) are the ratios of consecutive terms of A001109. The lower approximants are the ratios of consecutive terms from the related series A001653.

The Sloane’s Sequence page shows some other interesting properties of this sequence.

> [@](#):
>
> 207,878,255: 2.16\*10^16 = 146,992,124^2

I think not; RHS is _slightly_ smaller than LHS. A large number which _does_ fit the pattern is  
384199200: 73804512832419600 = 271669860^2

---

<div class="post-metadata">

**Author:** ![Oukile](https://avatars.discourse-cdn.com/v4/letter/o/13edae/32.png) [@Oukile](https://boards.straightdope.com/u/Oukile)\
**Post date:** [March 30, 2017, 1:41am UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/13 "2017-03-30T01:41:43Z")

</div>

> [@74westy](#):
>
> 1 + 3 + 5 + … + 2k-1
> 
> add the sequence to itself in the opposite order
> 
> ```auto
> 
> 1 + 3 + 5 + ... + 2k-1 +
> 2k-1 + 2k-3 + 2k-5 + ... + 1 =
> 2k + 2k + 2k + ... + 2k
> 
> ```
> 
> Now divide by 2 because you added the sequence to itself. Remember there are k terms. You get k[sup]2[/sup]
> 
> When I was young and agile of mind. I proved this to myself while lying in bed with my eyes closed after the sequence of integer squares was mentioned in an Arthur C. Clark book I was reading. I did it by induction that time so I wasn’t _that_ agile of mind.

Or another way to put it:  
k^2-(k-1)^2 = k^2 - k^2 +2k -1 = 2k-1.

So you go from one square ((k-1)^2) to the next square (k^2) by adding the next odd number of your series (2k-1).

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [March 30, 2017, 12:32pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/14 "2017-03-30T12:32:48Z")

</div>

These numbers are fascinating. Lots of stuff to play with, as the OEIS pages for this and related sequences shows. Just taking every other number and looking at those sequences alone shows interesting patterns.

Need … to … stop … analyzing … them. (Presumably all the good stuff has been found already anyway.)

But a nice spotting by the OP.

---

<div class="post-metadata">

**Author:** ![Crane](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crane/32/3495_2.png) [@Crane](https://boards.straightdope.com/u/Crane)\
**Post date:** [March 30, 2017, 2:23pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/15 "2017-03-30T14:23:32Z")

</div>

Septimus#12,

The last line was a victim of floating point errors.

After going through this exercise I can better understand  
the comments of A001108, but much of it is above my math  
grade.

Are these patterns mathematically significant or do they border  
on the strained coincidences of numerology. Consider The difference  
between the cubes of two sequential integers (m,n):

n^3 - m^3 = 3 m^2 + 3 m +1

Solving for m=1,2,3,4,5,6 = 7, 19, 37,61,91,127

The digit sum of each value is: 7,1,1,7,1,1

For any value of m\>1 that follows an integer divisible by 3 the digit sum is 7.  
For all other values of m\>1 the digit sum is 1.

Fascinating stuff, but does it have a practical value.

Crane

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [March 30, 2017, 2:50pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/16 "2017-03-30T14:50:21Z")

</div>

It’s said that when a student asked Euclid what was the practical value of studying geometry, Euclid said to his servant “Give him three pence, since he must make gain out of what he learns”.

---

<div class="post-metadata">

**Author:** ![Crane](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crane/32/3495_2.png) [@Crane](https://boards.straightdope.com/u/Crane)\
**Post date:** [March 30, 2017, 6:28pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/17 "2017-03-30T18:28:03Z")

</div>

The question is serious not facetious.

Crane

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [March 31, 2017, 10:27am UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/18 "2017-03-31T10:27:28Z")

</div>

You can generate these numbers like so: consider the powers of 3 + sqrt(8); that is, starting with 1, repeatedly multiply by 3 + sqrt(8). Each such value can be written as A + B \* sqrt(8) for some A and B.

The successive coefficients B generated in this way will be the values 0, 1, 6, 35, 204, etc., whose squares are also triangular numbers. All square triangular numbers are generated this way.

Why is that?

Well, the sum of values from 1 through N is N \* (1 + N)/2 [because we’re summing N many numbers whose average is halfway between 1 and N], and some fiddling with the quadratic equation shows that x = N \* (1 + N)/2 just in case N = (sqrt(8x + 1) - 1)/2. Thus, an integer x is is triangular if and only if (sqrt(8x + 1) - 1)/2 is an integer. This occurs if and only if sqrt(8x + 1) is an odd integer, which is to say if and only if 8x + 1 is an odd square. Well, since 8x + 1 is clearly odd, this reduces to just the condition that 8x + 1 is square.

So a square number B^2 is triangular just in case there’s also some A such that 8B^2 + 1 = A^2; i.e., such that A^2 - 8B^2 = 1.

From this point on, the reasoning proceeds exactly as in [this](http://boards.straightdope.com/sdmb/showpost.php?p=17832213&postcount=12) old post of mine, just replacing the role of 2 with 8 (in particular, using **Crane** numbers where J^2 = 8 instead of **Reyemile** numbers where J^2 = 2).

---

<div class="post-metadata">

**Author:** ![phaemon](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@phaemon](https://boards.straightdope.com/u/phaemon)\
**Post date:** [March 31, 2017, 1:48pm UTC](https://boards.straightdope.com/t/a-math-curiosity/783293/19 "2017-03-31T13:48:49Z")

</div>

It might be worth mentioning that this is the first example in the Wikipedia entry for “Proof without words”: [Proof without words - Wikipedia](https://en.wikipedia.org/wiki/Proof_without_words)

EDIT: Oops, just realised I misread not only the question, but also the replies. Left because it’s cool anyway.
