login
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).
0

%I #19 Jul 11 2018 04:31:33

%S 1,9,25,25,49,81,81,121,169,225,225,289,361,361,441,529,625,625,729,

%T 841,841,961,1089,1089,1225,1369,1521,1521,1681,1849,1849,2025,2209,

%U 2401,2401,2601,2809,2809,3025,3249,3249,3481,3721,3969,3969,4225,4489,4489,4761,5041,5329,5329,5625,5929,5929

%N 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).

%C If we calculate the first difference of this sequence and then substitute nonzero numbers as 1, we get exactly A080764.

%C If we include boundary points of the squares we get same sequence (obviously).

%C Duplicates appear at 4, 7, 11, 14, 18, 21, 24, 28, 31, 35, 38, 41, 45, 48, 52, 55 (= A083051 ?). - _Robert G. Wilson v_, Jun 20 2018

%F a(n) = A051132(n) - A303642(n).

%o (Python)

%o import math

%o for n in range (1, 100):

%o .count=0

%o .for x in range (-n, n):

%o ..for y in range (-n, n):

%o ...if ((2*x*x < n*n) and (2*y*y < n*n)):

%o ....count=count+1

%o .print(count)

%o (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

%Y Cf. A080764, A049472, A051132, A303642.

%K nonn

%O 1,2

%A _Kirill Ustyantsev_, May 05 2018