[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the number of lattice points in a Cartesian grid between an equilateral triangle and an inscribed circle of radius n; one of the side of triangle is perpendicular to the X-axis; the circle's center is at the origin.
1

%I #27 May 25 2021 07:58:18

%S 0,5,14,29,42,65,94,123,154,187,234,289,328,383,436,507,572,645,716,

%T 789,884,961,1058,1159,1244,1347,1454,1573,1692,1805,1940,2057,2194,

%U 2325,2454,2621,2758,2927,3060,3221,3404,3571,3746,3909,4086,4293,4478,4677,4868,5061,5256,5465,5698,5915

%N a(n) is the number of lattice points in a Cartesian grid between an equilateral triangle and an inscribed circle of radius n; one of the side of triangle is perpendicular to the X-axis; the circle's center is at the origin.

%H Kirill Ustyantsev, <a href="https://www.desmos.com/calculator/j3ojy7gvmb">Geometric illustration</a>

%e For n = 2 we have 5 lattice points: (-1, 2); (-1, -2); (2, -1); (2, 1); (3, 0).

%o (Python)

%o import math

%o tan=math.sqrt(3)/3

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

%o count=0

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

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

%o if (x*x+y*y>n*n and y<-tan*x+2*tan*n and y>tan*x-2*tan*n and x>-n):

%o count=count+1

%o print(count)

%o (PARI) a(n) = sum(x=-n+1, 2*n, sum(y=-2*n, 2*n, ((x^2+y^2) > n^2) && (3*y^2 < (x-2*n)^2))); \\ _Michel Marcus_, May 22 2018

%Y Cf. A303644, A303646.

%K nonn

%O 1,2

%A _Kirill Ustyantsev_, Apr 29 2018