cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A242394 Number of equilateral triangles (sides length = 1) that intersect the circumference of a circle of radius n centered at (0,0).

This page as a plain text file.
%I A242394 #13 May 18 2014 11:13:02
%S A242394 6,18,30,42,54,66,66,102,114,126,138,150,150,162,198,210,222,234,222,
%T A242394 270,258,294,306,318,330,330,366,354,390,402,390,426,450,462,450,486,
%U A242394 474,486,510,546,558,546,558,594,606,630,642,654,618,678,690,690,726,738,750,738,750
%N A242394 Number of equilateral triangles (sides length = 1) that intersect the circumference of a circle of radius n centered at (0,0).
%C A242394 For all n, there are at least 6 points where the transit of circumference occurs exactly at the corners. The rare case is when the transit occurs at 2 corners of a triangle, i.e., at n = 1, 13, 181, 35113, ... , (A001570(n)). The pattern repeats itself at every Pi/3 sector along the circumference. The triangle count per half sector by rows can be arranged as an irregular triangle as shown in the illustration. The rows count (A242396) is equal to the case centered at (1/2,0), A242395.
%H A242394 Kival Ngaokrajang, <a href="/A242394/a242394_2.pdf">Illustration of initial terms</a>
%H A242394 Kival Ngaokrajang, <a href="/A242394/a242394_1.pdf">Illustration for rare cases</a>
%o A242394 (Small Basic)
%o A242394 For n =1 To 100
%o A242394   r6=n*math.Sin(30*Math.Pi/180)/(Math.Power(3,0.5)/2)
%o A242394   r6a=math.Round(r6)
%o A242394   If r6-math.Floor(r6) >0.5 Then
%o A242394     last=1
%o A242394   Else
%o A242394     last=2
%o A242394   EndIf
%o A242394   'find corner intersecting points-----------------------
%o A242394     k=0
%o A242394     ic=0
%o A242394     h=Math.Power(1-0.5*0.5,0.5)
%o A242394     c=math.Floor(n/h)
%o A242394     For i = h To c Step h
%o A242394       For j = 0.5 To n Step 0.5
%o A242394         r=Math.Power(i*i+j*j,0.5)
%o A242394         If r = n Then
%o A242394           k=k+1
%o A242394         EndIf
%o A242394       EndFor
%o A242394     EndFor
%o A242394     if k > 1 then
%o A242394       ic=math.Floor(k/3)
%o A242394     EndIf
%o A242394   '------------------------------------------------------
%o A242394   a=0
%o A242394   b=0
%o A242394   For ii=1 To r6a
%o A242394     If ii=1 Then
%o A242394       a=a+1
%o A242394     Else
%o A242394       If ii = r6a Then
%o A242394         a=a+last
%o A242394       Else
%o A242394         a=a+2
%o A242394       EndIf
%o A242394     EndIf
%o A242394     b=a
%o A242394   EndFor
%o A242394   if n =1 then
%o A242394     aa = 1
%o A242394   Else
%o A242394     aa =1*(a-2*ic)*2+1
%o A242394   endif
%o A242394   TextWindow.Write(6*aa+", ")
%o A242394 EndFor
%Y A242394 Cf. A001570, A242118.
%K A242394 nonn
%O A242394 1,1
%A A242394 _Kival Ngaokrajang_, May 13 2014