OFFSET
0,1
COMMENTS
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.
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..1000
EXAMPLE
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).
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Oct 14 2006
EXTENSIONS
Data section corrected and extended by Giovanni Resta, Jun 13 2016
STATUS
approved