Interestingly for triangular numbers:
$X(X+1)+Y(Y+1)=Z(Z+1)+a$
$a$ - this number is determined by the condition of the problem. Are all numbers equation has a solution? And what kind of formula in general is?
Interestingly for triangular numbers:
$X(X+1)+Y(Y+1)=Z(Z+1)+a$
$a$ - this number is determined by the condition of the problem. Are all numbers equation has a solution? And what kind of formula in general is?
On
Well why not?
If the equation: $X(X\pm1)+Y(Y\pm1)=Z(Z\pm1)+a$
The number can be set as follows: $a=\frac{q^2-1}{4}$
Then using the appropriate equation Pell: $p^2-2s^2=\pm1$
Solutions can be written as:
$X=(2L+1+q)s^2+(q+2L)ps-(\frac{1-q}{2})p^2$
$Y=(1+q)s^2+(q+2L)ps+(L-\frac{1-q}{2})p^2$
$Z=(2L+1+q)s^2+2(q+L)ps+(L-\frac{1-q}{2})p^2$
Or.
$X=(2L+1-q)s^2+(q-2L)ps-(\frac{1+q}{2})p^2$
$Y=(1-q)s^2+(q-2L)ps+(L-\frac{1+q}{2})p^2$
$Z=(2L+1-q)s^2+2(q-L)ps+(L-\frac{1+q}{2})p^2$
$L$ - any integer given by us. And all the numbers can be any character.
On
If the equation:
$X(X+1)+Y(Y+1)=Z(Z+1)+q$
We write the solution if the number of: $q=(a-b)(a+b+1)$ This can be represented as ideal:
Then use the equation Pell: $p^2-2k(k-t)s^2=1$
$k,t$ - integers asked us.
Then the solution can be written:
$X=((2b+1)k-(2a+1)t)ps+2((a+1)k^2-(a+b+1)kt+bt^2)s^2$
$Y=ap^2+((2b+1)k-2bt)ps+2(k^2+(b-a-1)kt)s^2$
$Z=bp^2+(2(a+1)k-(2a+1)t)ps+2((b+1)k^2-(a+b+1)kt+bt^2)s^2$
Or again:
$X=(2b-2a-1)p^2+((6b-4a-1)k+(2a-4b+1)t)ps+$$2((2b-a)k^2-(3b-a)kt+bt^2)s^2$
$Y=(2b-a-1)p^2+((6b-4a-1)k-2bt)ps+2(2(b-a)k^2-(b-a)kt)s^2$
$Z=(3b-2a-1)p^2+((8b-6a-2)k+(2a-4b+1)t)ps+$ $+2((3b-2a)k^2-(3b-a)kt+bt^2)s^2$
Gauss proved that every number is a sum of three triangular numbers. I don't think there's a good formula for the summands.