OFFSET
0,5
LINKS
Peter Kagey, Table of n, a(n) for n = 0..10000
EXAMPLE
a(3) = 1 because 3 + a(1) is a perfect square.
a(4) = 2 because 4 + a(0) and 4 + a(2) are perfect squares.
MATHEMATICA
a = {0}; Do[AppendTo[a, Count[a + n, k_ /; IntegerQ@ Sqrt@ k]], {n, 79}]; a (* Michael De Vlieger, May 25 2016 *)
PROG
(Java)
int n = 1000;
int[] terms = new int[n];
for (int i = 0; i < n; i++) {
for (int j = 0; j < i; j++) {
if (Math.sqrt(i+terms[j]) == Math.floor(Math.sqrt(i+terms[j]))) {
terms[i]++;
}
}
System.out.print(terms[i] + ", ");
}
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alec Jones, May 17 2016
STATUS
approved