wfl>You're solving y^2 = x(x+1)/2, and the solutions y comprise a
second-order linear recurrence (and y^2 third-order), as any fule no --- but the x evidently do not (and of course, there's actually no reason to suppose that they might).
But notice I imposed recurrencehood on x(x+1)/2 !
I'm not sure I'd have recognised the distinction in good time, either ... Nice elephant trap! WFL
Seriously! --rwg On 2/23/10, Bill Gosper <billgosper@gmail.com <http://gosper.org/webmail/src/compose.php?send_to=billgosper%40gmail.com>> wrote:
A few years ago I mentioned an effective way to list the square triangular numbers by brute force finding the first few, and then computing each new one from the previous six so as to annihilate the determinant of a 4x4 Toeplitz matrix.
How can this fail:
(c256) subset(-9..9,lambda([x],integerp(sqrt(binomial(x+1,2)))))
(d256) [- 9, - 2, - 1, 0, 1, 8]
(c257) genmatrix(lambda([i,j],(''(endcons(x,%*(%+1)/2)))[i+j-1]),4)
[ 36 1 0 0 ] [ ] [ 1 0 0 1 ] (d257) [ ] [ 0 0 1 36 ] [ ] [ 0 1 36 x ]
(c258) sqrt(solve(det(%)))
(d258) [sqrt(x) = 6 sqrt(35)]
while this succeeds?
(c261) delete(-1,subset(-50..9,lambda([x],integerp(sqrt(binomial(x+1,2))))))
(d261) [- 50, - 9, - 2, 0, 1, 8]
(c262) genmatrix(lambda([i,j],(''(endcons(x,%*(%+1)/2)))[i+j-1]),4)
[ 1225 36 1 0 ] [ ] [ 36 1 0 1 ] (d262) [ ] [ 1 0 1 36 ] [ ] [ 0 1 36 x ]
(c263) sqrt(solve(det(%)))
(d263) [sqrt(x) = 35]
(c280) genmatrix(lambda([i,j],(''(append(d261*(d261+1)/2,[35^2,x])))[i+j]),4)
[ 36 1 0 1 ] [ ] [ 1 0 1 36 ] (d280) [ ] [ 0 1 36 1225 ] [ ] [ 1 36 1225 x ]
(c281) sqrt(solve(det(%)))
(d281) [sqrt(x) = 204] etc. --rwg