Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 Sep 14 2024 02:27:51
%S 0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,
%T 1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,1,0,1,3,0,3,
%U 1,0,1,3,0,3,1,0,1,3,0
%N Periodic sequence 0, 3, 1, 0, 1, 3.
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,1).
%F a(n) = (4/3)*(sin(n*Pi/6)+sin(n*Pi/2))^2.
%e n=0 (4/3)*(sin(0)+sin(0))^2 = 0.
%e n=1 (4/3)*(sin(Pi/6)+sin(Pi/2))^2 = (4/3)*(1/2+1)^2 = (4/3)*(9/4) = 3.
%e n=2 (4/3)*(sin(Pi/3)+sin(Pi))^2 = (4/3)*(((3)^.5)/2+0)^2 = (4/3)*(3/4) = 1.
%e n=3 (4/3)*(sin(Pi/2)+sin(3*Pi/2))^2 = (4/3)*(1-1)^2 = 0.
%e n=4 (4/3)*(sin(2*Pi/3)+sin(2*Pi))^2 = (4/3)*(((3)^.5)/2+0)^2 = (4/3)*(3/4) = 1.
%e n=5 (4/3)*(sin(5*Pi/6)+sin(5*Pi/2))^2 = (4/3)*(1/2+1)^2 = (4/3)*(9/4) = 3.
%p P:=proc(n) local i,j; for i from 0 by 1 to n do j:=4/3*(sin(i*Pi/6)+sin(i*Pi/2))^2; print(j); od; end: P(20);
%K easy,nonn
%O 0,2
%A _Paolo P. Lava_ and _Giorgio Balzarotti_, Jun 21 2006