

A121383


a(0)=3. a(n) = number of earlier terms which, each added to n, sum to a square.


1



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, 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, 0, 0, 1, 1, 0, 1, 0, 2, 0, 2, 1, 1, 2, 2, 16, 26, 22, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)



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, n1], IntegerQ@ Sqrt[n + a[#]] &]; a /@ Range[0, 90] (* Giovanni Resta, Jun 13 2016 *)


CROSSREFS

Cf. A123396.
Sequence in context: A307753 A181116 A051834 * A194521 A181434 A294018
Adjacent sequences: A121380 A121381 A121382 * A121384 A121385 A121386


KEYWORD

easy,nonn


AUTHOR

Jonathan Vos Post, Oct 14 2006


EXTENSIONS

Data section corrected and extended by Giovanni Resta, Jun 13 2016


STATUS

approved



