OFFSET
1,3
COMMENTS
This sequence is infinite as, for example, all integers of the form m^8+m^4-2*m^2*n^2+12*m^6*n^2+n^4+38*m^4*n^4+12*m^2*n^6+n^8 are included.
The sequence includes all squares, since n^2 = T(n-1) + T(n), where T(n) = A000217(n) is the n-th triangular number. - Franklin T. Adams-Watters, Jun 24 2011
LINKS
P. A. Piza, Problems for Solution: 4425 The American Mathematical Monthly, Vol. 58, No. 2, (February 1951), p. 113.
P. A. Piza, G. W. Walker, and C. M. Sandwick, Sr., 4425, The American Mathematical Monthly, Vol. 59, No. 6, (June - July 1952), pp. 417-419.
EXAMPLE
9 is the sum of two triangular numbers: 6 + 3, and also two squares: 9 + 0. Hence 9 is in the sequence.
MATHEMATICA
data=Length[Reduce[a^2+b^2==1/2 c (c+1)+1/2 d(d+1) == # && a>=0 && b>=0 && c>=0 && d>=0, {a, b, c, d}, Integers]] &/@Range[0, 250]; Prepend[DeleteCases[Table[If[data[[k]]>0, k-1, 0], {k, 1, Length[data]}], 0], 0]
With[ {n = 250}, Pick[ Range[ 0, n], {} != FindInstance[ a*a + b*b == # && c (c + 1) + d (d + 1) == 2 # && a >= 0 && b >= 0 && c >= 0 && d >= 0, {a, b, c, d}, Integers] & /@ Range[ 0, n]]] (* Michael Somos, Jun 24 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ant King, Jun 22 2011
STATUS
approved