|
|
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
|
|
|
1, 1, 2, 3, 5, 4, 4, 9, 12, 12, 21, 25, 25, 46, 58, 58, 104, 129, 129, 233, 291, 291, 524, 653, 653, 1177, 1468, 1468, 2645, 3298, 3298, 5943, 7411, 7411, 13354, 16652, 16652, 30006, 37417, 37417, 67423, 84075, 84075, 151498, 188915, 188915, 340413, 424488
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
A sequentially switched sequence modulo 3.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 2*a(n-3)+a(n-6)-a(n-9) for n>11.
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).
(End)
|
|
MAPLE
|
a:= proc(n) option remember; add(a(n-i), i=1+(n mod 3)..1+2*(n mod 3)) end proc:
a(0):= 1: a(1):= 1: a(2):= 2: a(3):= 3: a(4):= 5:
|
|
MATHEMATICA
|
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}]
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Typos in title and formula fixed by Colin Barker, Nov 18 2015
|
|
STATUS
|
approved
|
|
|
|