Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Feb 16 2015 11:20:14
%S 1,1,1,1,2,1,3,2,1,1,2,2,2,2,1,2,4,2,2,2,4,2,4,1,2,4,2,2,2,3,3,4,3,1,
%T 2,2,4,4,4,2,4,2,5,4,1,3,6,4,2,3,3,3,5,2,2,5,5,3,3,3,3,4,3,1,5,5,4,6,
%U 2,2,6,4,6,5,4,2,6,3,3,3,5,5,6,3,2,7,2,4,4,2,5,6,6,3,4,5,2,6,3,2,6
%N Number of solutions to the equation n = x^2 + y*(y+1)/2 + z*(z+1)/2 (x,y,z=0,1,...) with x == Floor[sqrt(n)] (mod 2) and y <= z.
%C 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.
%C 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.
%D L. E. Dickson, History of the Theory of Numbers, vol. II, AMS Chelsea Publ., 1999, p. 24.
%H Zhi-Wei Sun, <a href="/A255191/b255191.txt">Table of n, a(n) for n = 0..10000</a>
%H Zhi-Wei Sun, <a href="http://dx.doi.org/10.4064/aa127-2-1">Mixed sums of squares and triangular numbers</a>, Acta Arith. 127(2007), 103-113.
%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1502.03056">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)</a>, arXiv:1502.03056 [math.NT], 2015.
%e a(14) = 1 since 14 = 1^2 + 2*3/2 + 4*5/2 with floor(sqrt(14)) == 1 (mod 2).
%e a(44) = 1 since 44 = 4^2 + 0*1/2 + 7*8/2 with floor(sqrt(44)) == 4 (mod 2).
%e a(63) = 1 since 63 = 5^2 + 4*5/2 + 7*8/2 with floor(sqrt(63)) == 5 (mod 2).
%t TQ[n_]:=IntegerQ[Sqrt[8n+1]]
%t 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}];
%t Print[n," ",r];Label[aa];Continue,{n,0,100}]
%Y Cf. A000217, A000290, A254885.
%K nonn
%O 0,5
%A _Zhi-Wei Sun_, Feb 16 2015