OFFSET
0,4
COMMENTS
a(n)/(n/2)^2 --> Pi*2/sqrt(3) (see A186706).
MAPLE
A053458 := proc(d)
local a, j, imin, imax ;
a := 0 ;
for j from -floor(d/sqrt(3)) do
if j^2*3 >= d^2 and j>= 0 then
break ;
end if;
imin := (-j-sqrt(d^2-3*j^2))/2 ;
if type(imin, integer) then
imin := imin+1 ;
else
imin := ceil(imin) ;
end if;
imax := (-j+sqrt(d^2-3*j^2))/2 ;
if type(imax, integer) then
imax := imax -1 ;
else
imax := floor(imax) ;
end if;
a := a+imax-imin+1 ;
end do:
a ;
end proc:
seq(A053458(d), d=0..30) ; # R. J. Mathar, Nov 22 2022
MATHEMATICA
a[n_] := Sum[Boole[4*(i^2 + i*j + j^2) < n^2], {i, -n, n}, {j, -n, n}];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 05 2023 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Jan 13 2000
STATUS
approved