[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”).

Revision History for A303706 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
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.
(history; published version)
#27 by Peter Luschny at Tue May 25 07:58:18 EDT 2021
STATUS

reviewed

approved

#26 by Joerg Arndt at Tue May 25 06:12:27 EDT 2021
STATUS

proposed

reviewed

#25 by Kevin Ryde at Tue May 25 05:30:45 EDT 2021
STATUS

editing

proposed

#24 by Kevin Ryde at Tue May 25 05:29:51 EDT 2021
PROG

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)

#23 by Kevin Ryde at Tue May 25 05:28:41 EDT 2021
PROG

. 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)

#22 by Kevin Ryde at Tue May 25 05:25:28 EDT 2021
NAME

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.

STATUS

approved

editing

Discussion
Tue May 25
05:25
Kevin Ryde: Ascii c.
#21 by Alois P. Heinz at Mon May 28 19:40:50 EDT 2018
STATUS

reviewed

approved

#20 by Michael B. Porter at Sat May 26 16:49:10 EDT 2018
STATUS

proposed

reviewed

#19 by Michel Marcus at Tue May 22 03:35:40 EDT 2018
STATUS

editing

proposed

Discussion
Tue May 22
06:19
Kirill Ustyantsev: Yes, we can! Your code is more concise, but seems not so visual. I purposely printed lines in form "y=mx+b" and put not needed condition "x>-n" for demonstrating third line of triangle. 

But which way is better for OEIS?
07:31
Andrey Zabolotskiy: Well, generally, if floating-point calculations can be avoided, it's better to avoid them.
#18 by Michel Marcus at Tue May 22 03:35:06 EDT 2018
PROG

(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

STATUS

proposed

editing

Discussion
Tue May 22
03:35
Michel Marcus: I think we can avoid having sqrt(3)/3 in the code, right ?