OFFSET
0,5
COMMENTS
By Dickson's book in the reference, E. Lionnet observed in 1872 that any nonnegative integer can be written as the sum of a square and two triangular numbers.
We have a(n) > 0 for all n. This follows from Theorem 1(i) and Lemma 2 of Sun's reference in 2007. Note that if n = m*(m+1) with m a nonnegative integer then floor(sqrt(n)) = m.
REFERENCES
L. E. Dickson, History of the Theory of Numbers, vol. II, AMS Chelsea Publ., 1999, p. 24.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
Zhi-Wei Sun, Mixed sums of squares and triangular numbers, Acta Arith. 127(2007), 103-113.
Zhi-Wei Sun, On universal sums a*x^2+b*y^2+f(z), a*T_x+b*T_y+f(z) and a*T_x+b*y^2+f(z), arXiv:1502.03056 [math.NT], 2015.
EXAMPLE
a(14) = 1 since 14 = 1^2 + 2*3/2 + 4*5/2 with floor(sqrt(14)) == 1 (mod 2).
a(44) = 1 since 44 = 4^2 + 0*1/2 + 7*8/2 with floor(sqrt(44)) == 4 (mod 2).
a(63) = 1 since 63 = 5^2 + 4*5/2 + 7*8/2 with floor(sqrt(63)) == 5 (mod 2).
MATHEMATICA
TQ[n_]:=IntegerQ[Sqrt[8n+1]]
Do[r=0; Do[If[Mod[Floor[Sqrt[n]]-x, 2]==0&&TQ[n-x^2-y*(y+1)/2], r=r+1], {x, 0, Sqrt[n]}, {y, 0, (Sqrt[4(n-x^2)+1]-1)/2}];
Print[n, " ", r]; Label[aa]; Continue, {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 16 2015
STATUS
approved