# Are there infinitely-many numbers that are both square and triangular?

I just started to read "Friendly Introduction to Number Theory" but I am getting stuck in the first exercises.

1.1. The first two numbers that are both squares and triangles are 1 and 36. Find the next one and, if possible, the one after that. Can you figure out an efficient way to find triangular–square numbers? Do you think that there are infinitely many?

https://www.math.brown.edu/~jhs/frintch1ch6.pdf

I found how to find out the number which is both square and triangle. (don't know if this is effective way)

https://github.com/y-zono/friendly-introduction-number-theory/blob/master/01/1-1/main.go

However how can I answer "Do you think that there are infinitely many?"? I think I need to find the formula but no idea yet. Can you please help me?

Have a look at https://en.wikipedia.org/wiki/Square_triangular_number So, the answere is yes!

• Thank you for great reference. I did not know the term "Square triangular number". – zono Oct 15 '18 at 11:24
• Almost a link-only answer..... (at least it says the answer is yes if the link breaks) – user202729 Oct 15 '18 at 14:18

Of course the solution of equation:

$$Y^2=\frac{X(X\pm1)}{2}$$

Defined solutions of Pell's equation: $$p^2-2s^2=\pm1$$

But it is necessary to write the formula describing their solutions through solving Pell's equation:

$$X=p^2+4ps+4s^2$$

$$Y=p^2+3ps+2s^2$$

And more.

$$X=2s^2$$

$$Y=ps$$

$$p,s$$ - These numbers can be any character. If you need to have a solution of the equation: $$Y^2=\frac{X(X\pm{a})}{2}$$

It is necessary to substitute into the formulas uravneniyaPellya solutions: $$p^2-2s^2=\pm{a}$$

• Thank you so much! Give me for a while to understand it. So many information for me. I think it will take few days.. – zono Oct 15 '18 at 11:30

There is a closely related problem. Do their exists an infinite number of triples (x,y,z) such that x,y,and z are consecutive integers each being expressible as the sum of two not necessarily distinct integer squares? For example $$0=0^2+0^2;1=0^2+1^2;2=1^2+1^2$$ $$8=2^2+2^2; 9=0^2+3^2; 10=3^2+1^2$$.

In the latter case, the triple takes the form $$2m^2+2=n^2+1$$, or $$n^2-2m^2=1$$ Pell's equation again.

So if you can construct or prove the existence of an infinite number of such triples, you have found an infinite number of square triangular numbers.

The formula for triangle numbers is on page 9. Create an equation with the left being that formula using x, and the right the formula for squares, using y. X and y are not equal, but you can rearrange terms. Ask, when is the left divisible by something on the right? Are we sure that such divisibility exists for higher numbers?

Better, assume we have such an x and y. Can we always add something to each to get the next number?

• Thank you! Now I'm trying to understand what you are saying... not easy for me. (my English skills is not good too) – zono Oct 15 '18 at 11:27
• Good luck to you. The other answers are very detailed, but you have to do only enough to answer the question, are there infinitely many? I read the chapter, and it wants you to think about things that we can show go on forever, and other things that are conjectures (twin primes is one... we think it goes on forever but we do not know.) – Russ Oct 15 '18 at 11:57
• Also, thank you for trying before asking, and welcome to the board! :-) – Russ Oct 15 '18 at 11:59