A253900 a(n) is the number of squares of the form x^2 + x + n^2 for 0 <= x <= n^2.
1, 2, 2, 3, 3, 2, 4, 4, 2, 4, 4, 3, 6, 4, 2, 4, 8, 4, 4, 4, 2, 6, 6, 3, 6, 4, 4, 8, 4, 2, 6, 12, 4, 4, 4, 2, 6, 12, 4, 5, 5, 4, 8, 4, 4, 8, 8, 4, 6, 6, 2, 8, 8, 2, 4, 4, 4, 12, 12, 6, 6, 8, 4, 4, 4, 4, 16, 8, 2, 4, 8, 8, 12, 6, 2, 6, 12, 4, 4, 8, 4, 8, 8, 3, 9
Offset: 1
Keywords
Examples
a(7) = 4 because the 4 squares of the form x^2 + x + 7^2 are 49, 121, 289, 2401 for x = 0, 8, 15, 48, respectively. a(8) = 4 because the 4 squares of the form x^2 + x + 8^2 are 64, 196, 484, 4096 for x = 0, 11, 20, 63, respectively.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
lst={}; Do[k=0; Do[If[IntegerQ[Sqrt[x^2+x+n^2]], k=k+1], {x, 0, n^2}]; AppendTo[lst, k], {n, 1, 100}]; lst
-
PARI
a(n) = sum(x=0, n^2, issquare(x^2 + x + n^2)); \\ Michel Marcus, Jan 21 2015
Comments