A304035 a(n) is the number of lattice points inside a square bounded by the lines x=-n/sqrt(2), x=n/sqrt(2), y=-n/sqrt(2), y=n/sqrt(2).
1, 9, 25, 25, 49, 81, 81, 121, 169, 225, 225, 289, 361, 361, 441, 529, 625, 625, 729, 841, 841, 961, 1089, 1089, 1225, 1369, 1521, 1521, 1681, 1849, 1849, 2025, 2209, 2401, 2401, 2601, 2809, 2809, 3025, 3249, 3249, 3481, 3721, 3969, 3969, 4225, 4489, 4489, 4761, 5041, 5329, 5329, 5625, 5929, 5929
Offset: 1
Keywords
Programs
-
PARI
a(n) = sum(x=-n, n, sum(y=-n, n, ((2*x^2 < n^2) && (2*y^2 < n^2)))); \\ Michel Marcus, May 22 2018
-
Python
import math for n in range (1, 100): count=0 for x in range (-n, n): for y in range (-n, n): if ((2*x*x < n*n) and (2*y*y < n*n)): count=count+1 print(count)
Comments