[Math] Are there infinitely-many numbers that are both square and triangular

number theory

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?

Best Answer

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}$$