[go: up one dir, main page]

login
A362873
a(n) is the number of points with integer coordinates that are inside an equilateral triangle inscribed in a circle of radius n, the location of the triangle in the Oxy coordinate plane is described in the comments.
2
1, 4, 12, 17, 33, 42, 64, 77, 105, 122, 158, 177, 219, 242, 292, 319, 375, 406, 470, 503, 573, 610, 688, 729, 813, 856, 948, 995, 1093, 1144, 1248, 1303, 1415, 1472, 1592, 1653, 1779, 1844, 1976, 2045, 2185, 2256, 2402, 2477, 2631, 2710, 2870, 2951, 3119, 3204, 3378, 3467, 3649
OFFSET
1,2
COMMENTS
An equilateral triangle is located in the coordinate plane Oxy so that its center coincides with the origin O, one of the vertices lies on the Oy axis.
FORMULA
a(n) = (3*n - 2)/2 + 2*Sum_{k=1..floor(sqrt(3)*n/2)} floor(-sqrt(3)*k + 3*n/2) if n is even;
a(n) = (3*n - 1)/2 + 2*Sum_{k=1..floor(sqrt(3)*n/2)} floor(-sqrt(3)*k + (3*n + 1)/2) if n is odd.
EXAMPLE
a(3) = 4 + 2*4 = 12;
a(4) = 5 + 2*6 = 17.
MATHEMATICA
a[n_]:=(3n-2+Mod[n, 2])/2+2Sum[Floor[(3n+Mod[n, 2])/2-Sqrt[3]k], {k, Floor[Sqrt[3]n/2]}]; Array[a, 53] (* Stefano Spezia, May 08 2023 *)
CROSSREFS
Sequence in context: A303795 A175704 A350602 * A111371 A078514 A324519
KEYWORD
nonn
AUTHOR
Nicolay Avilov, May 07 2023
STATUS
approved