login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A104204 If n==0 (mod 3) then a(n)=a(n-1); if n==1 (mod 3) then a(n)=a(n-2)+a(n-3); if n==2 (mod 3) then a(n)=a(n-3)+a(n-4)+a(n-5). 1

%I #15 Nov 19 2015 05:25:34

%S 1,1,2,3,5,4,4,9,12,12,21,25,25,46,58,58,104,129,129,233,291,291,524,

%T 653,653,1177,1468,1468,2645,3298,3298,5943,7411,7411,13354,16652,

%U 16652,30006,37417,37417,67423,84075,84075,151498,188915,188915,340413,424488

%N If n==0 (mod 3) then a(n)=a(n-1); if n==1 (mod 3) then a(n)=a(n-2)+a(n-3); if n==2 (mod 3) then a(n)=a(n-3)+a(n-4)+a(n-5).

%C A sequentially switched sequence modulo 3.

%H Colin Barker, <a href="/A104204/b104204.txt">Table of n, a(n) for n = 0..1000</a>

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

%F From _Colin Barker_, Nov 18 2015: (Start)

%F a(n) = 2*a(n-3)+a(n-6)-a(n-9) for n>11.

%F G.f.: -(x^11+x^10-2*x^9-2*x^8+2*x^7+3*x^6-3*x^4-x^3-2*x^2-x-1) / (x^9-x^6-2*x^3+1).

%F (End)

%p a:= proc(n) option remember; add(a(n-i),i=1+(n mod 3)..1+2*(n mod 3)) end proc:

%p a(0):= 1: a(1):= 1: a(2):= 2: a(3):= 3: a(4):= 5:

%p seq(a(n),n=0..100); # _Robert Israel_, Nov 18 2015

%t a[n_Integer?Positive] := If[Mod[n, 3] == 0, a[n] = a[n - 1], If[Mod[n, 3] == 1, a[n] = a[n - 2] + a[n - 3], a[n] = a[n - 3] + a[n - 4] + a[n - 5]]] a[0] = 1; a[1] = 1; a[2] = 2; a[3] = 3; a[4] = 5; aa = Table[a[n], {n, 0, 200}]

%o (PARI) Vec(-(x^11+x^10-2*x^9-2*x^8+2*x^7+3*x^6-3*x^4-x^3-2*x^2-x-1)/(x^9-x^6-2*x^3+1) + O(x^60)) \\ _Colin Barker_, Nov 18 2015

%K nonn,easy

%O 0,3

%A _Roger L. Bagula_, Mar 13 2005

%E Typos in title and formula fixed by _Colin Barker_, Nov 18 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 02:28 EDT 2024. Contains 375995 sequences. (Running on oeis4.)