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

Period 6: repeat [1, 1, 1, 3, 3, 3].
3

%I #30 Feb 26 2024 02:01:05

%S 1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,

%T 3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,

%U 1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1

%N Period 6: repeat [1, 1, 1, 3, 3, 3].

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,-1,1).

%F G.f.: (1+3*x^3)/((1-x)*(1+x)*(1-x+x^2)). - _R. J. Mathar_, Nov 15 2007

%F a(n) = 2 - (2/3)*cos((1/3)*Pi*n) - (2/3)*3^(1/2)*sin((1/3)*Pi*n) + (1/3)*(-1)^(1+n). - _R. J. Mathar_, Nov 15 2007

%F a(n) = 2 - (-1)^floor(n/3). - _Bruno Berselli_, Jul 09 2013

%F a(n) = a(n-1) - a(n-3) + a(n-4) for n > 3. - _Wesley Ivan Hurt_, Jun 20 2016

%p A130974:=n->[1, 1, 1, 3, 3, 3][(n mod 6)+1]: seq(A130974(n), n=0..100); # _Wesley Ivan Hurt_, Jun 20 2016

%t PadRight[{}, 100, {1, 1, 1, 3, 3, 3}] (* _Wesley Ivan Hurt_, Jun 20 2016 *)

%o (Magma) &cat [[1, 1, 1, 3, 3, 3]^^30]; // _Wesley Ivan Hurt_, Jun 20 2016

%o (PARI) a(n) = [1, 1, 1, 3, 3, 3][n%6+1]; \\ _Jinyuan Wang_, Feb 26 2020

%Y Cf. A177957 (decimal expansion of (12+3*sqrt(35))/19). - _Klaus Brockhaus_, May 16 2010

%K nonn,easy

%O 0,4

%A _Paul Curtz_, Sep 28 2007