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 #7 Jun 13 2016 08:33:45
%S 3,1,0,1,1,0,1,0,4,3,0,0,1,2,1,6,5,0,0,1,1,1,2,2,9,7,0,1,0,1,1,1,1,2,
%T 4,14,9,0,0,0,2,0,1,1,1,2,2,7,17,13,1,1,0,0,0,2,0,2,1,1,2,2,11,21,18,
%U 0,0,1,1,0,1,0,2,0,2,1,1,2,2,16,26,22,1,1
%N a(0)=3. a(n) = number of earlier terms which, each added to n, sum to a square.
%C Does every nonnegative integer occur eventually? Analogous to A123396 a(0)=0. a(n) = number of earlier terms each of which, when added to n, the sum is a triangular number.
%H Giovanni Resta, <a href="/A121383/b121383.txt">Table of n, a(n) for n = 0..1000</a>
%e a(6) = 1 because the previous terms are 3, 1, 0, 1, 1, 0, and among them only one (3) added to 6 gives a square (9).
%t a[0] = 3; a[n_] := a[n] = Length@ Select[ Range[0, n-1], IntegerQ@ Sqrt[n + a[#]] &]; a /@ Range[0, 90] (* _Giovanni Resta_, Jun 13 2016 *)
%Y Cf. A123396.
%K easy,nonn
%O 0,1
%A _Jonathan Vos Post_, Oct 14 2006
%E Data section corrected and extended by _Giovanni Resta_, Jun 13 2016