## Thursday, December 31, 2020

### Square & Triangular Numbers

It's my vacation. And here I am, playing with math. Woo hoo.

If you've played with this problem before, perhaps this is boring and old hat. But I've seen the question many times, and never before have I followed up on it.

I just got a book I ordered. A Friendly Introduction to Number Theory, by Joseph Silverman. THe very first problem he asks the reader to attempt is:

Exercise 1.1. The first two numbers which are both squares and triangles are 1 and 36. Find the next one, and if possible, the one after that. Can you figure out a way to efficiently find triangle-square numbers? Do you think there are infinitely many?

I found the next one easily, by making lists on paper of the square and triangular numbers. It was about 6 times as big as 35 (which is about 6 times as big as 1). So I figured it would take too long to find another by hand. I wrote a Sage script. (It took me a few tries. I had lots more print statements until I was sure it was working.) I now have 7 of them. But more importantly, I've found a pattern. If you want to play with this, I would recommend not reading further.

.

.

.

.

.

The business about each one being about 6 times as big as the one before looked promising. So I checked. Let's call them m (for matching numbers), where the actual number is m2.

m0 = 1,

m1 = 6*m0=6,

m2 = 6*m1 - 1 = 35,

m3 = 6*m2 - 6 = 204,

m4 = 6*m3 - 35 = 1189.

At this point, it becomes clear that m(i) = 6*m(i-1) - m(i-2). And that's where I am now. I don't really know that this will continue to work forever. But it does continue for all the numbers I've found using Sage. And I just found one more to see if it continues further. It does.

Next step, proof. I will see if that's something I can do.

I just found a closed form for the formula. It's ugly but it works. (I learned how to do that step from Oscar Levin's Discrete Mathematics: An Open Introduction, in 2.4, Solving Recurrence Relations. That's the book I'll be using to teach discrete math from this coming semester.)

Now the next step is proof.... 