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.

A151899 Period 6: repeat [0, 0, 1, 1, 1, 2].

This page as a plain text file.
%I A151899 #29 Dec 12 2023 08:14:12
%S A151899 0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,
%T A151899 1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,
%U A151899 1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1,1,1,2,0,0,1
%N A151899 Period 6: repeat [0, 0, 1, 1, 1, 2].
%H A151899 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,1).
%F A151899 a(n) = 5/6 - cos(Pi*n/3)/3 - sin(Pi*n/3)/sqrt(3) - cos(2*Pi*n/3)/3 - sin(2*Pi*n/3)/sqrt(3) - (-1)^n/6. - _R. J. Mathar_, Oct 08 2011
%F A151899 G.f.: (x^2+x^3+x^4+2*x^5)/(1-x^6); a(n) = abs( mod(1-n,3) - mod(1+n,2) ). - _Wesley Ivan Hurt_, Aug 20 2014
%F A151899 a(n) = a(n-6) for n>5. - _Wesley Ivan Hurt_, Jun 20 2016
%p A151899 f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
%p A151899 A151899:=n->[0, 0, 1, 1, 1, 2][(n mod 6)+1]: seq(A151899(n), n=0..100); # _Wesley Ivan Hurt_, Jun 20 2016
%t A151899 Table[Abs[Mod[-n + 1, 3] - Mod[n + 1, 2]], {n, 0, 100}] (* _Wesley Ivan Hurt_, Aug 20 2014 *)
%t A151899 CoefficientList[Series[(x^2 + x^3 + x^4 + 2 x^5)/(1 - x^6), {x, 0, 100}], x] (* _Wesley Ivan Hurt_, Aug 20 2014 *)
%t A151899 LinearRecurrence[{0, 0, 0, 0, 0, 1},{0, 0, 1, 1, 1, 2},105] (* _Ray Chandler_, Aug 26 2015 *)
%o A151899 (Magma) [Abs( ((1-n) mod 3) - ((1+n) mod 2) ) : n in [0..100]]; // _Wesley Ivan Hurt_, Aug 20 2014
%o A151899 (PARI) a(n)=[0,0,1,1,1,2][n%6+1]; \\ _Joerg Arndt_, Aug 25 2014
%Y A151899 Cf. A151902, A151904, A151905, A151906, A151907.
%K A151899 nonn,easy
%O A151899 0,6
%A A151899 _N. J. A. Sloane_, Jul 31 2009