# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a303706 Showing 1-1 of 1 %I A303706 #27 May 25 2021 07:58:18 %S A303706 0,5,14,29,42,65,94,123,154,187,234,289,328,383,436,507,572,645,716, %T A303706 789,884,961,1058,1159,1244,1347,1454,1573,1692,1805,1940,2057,2194, %U A303706 2325,2454,2621,2758,2927,3060,3221,3404,3571,3746,3909,4086,4293,4478,4677,4868,5061,5256,5465,5698,5915 %N A303706 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 A303706 Kirill Ustyantsev, Geometric illustration %e A303706 For n = 2 we have 5 lattice points: (-1, 2); (-1, -2); (2, -1); (2, 1); (3, 0). %o A303706 (Python) %o A303706 import math %o A303706 tan=math.sqrt(3)/3 %o A303706 for n in range (1,71): %o A303706 count=0 %o A303706 for x in range (-n, 2*n): %o A303706 for y in range (-2*n, 2*n): %o A303706 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 A303706 count=count+1 %o A303706 print(count) %o A303706 (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 A303706 Cf. A303644, A303646. %K A303706 nonn %O A303706 1,2 %A A303706 _Kirill Ustyantsev_, Apr 29 2018 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE