reviewed
approved
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”).
reviewed
approved
proposed
reviewed
editing
proposed
count=0
for x in range (-n, 2*n):
for y in range (-2*n, 2*n):
if (x*x+y*y>n*n and y<-tan*x+2*tan*n and y>tan*x-2*tan*n and x>-n):
count=count+1
print(count)
. count=0
. for x in range (-n, 2*n):
.. for y in range (-2*n, 2*n):
... if (x*x+y*y>n*n and y<-tan*x+2*tan*n and y>tan*x-2*tan*n and x>-n):
.... count=count+1
. print(count)
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 сirclecircle's center is at the origin.
approved
editing
reviewed
approved
proposed
reviewed
editing
proposed
(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
proposed
editing