A math curiosity

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

Here’s the Online Encyclopedia of Integer Sequences entry for your sequence, which includes ways to generate it A001108 - OEIS

Andy,

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

Crane

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

add the sequence to itself in the opposite order



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.

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

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.

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.

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.

Yes, and googling square triangular numbers produces a number of sites about this phenomenon.

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

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

A001109 - OEIS mentions much about these numbers.

The circle inscribed in a 3-4-5 triangle has radius 1.
The circle inscribed in a 20-21-29 triangle has radius 6. (2021/(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.

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

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

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.

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

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

The question is serious not facetious.

Crane

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

It might be worth mentioning that this is the first example in the Wikipedia entry for “Proof without words”: Proof without words - Wikipedia

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