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

A102149
If mod(n,3)=0 then a(n) = a(n-1), if mod(n,3)=1 then a(n) = Q(n-2)+Q(n-3), if mod(,n,3)=2 then a(n-3)+a(n-4)+a(n-5), where Q() = A005185().
0
1, 1, 2, 3, 5, 4, 4, 7, 12, 12, 11, 23, 23, 14, 46, 46, 18, 83, 83, 21, 147, 147, 24, 251, 251, 28, 422, 422, 30, 701, 701, 32, 1153, 1153, 34, 1886, 1886, 40, 3073, 3073, 43, 4999, 4999, 46, 8115, 8115, 48, 13160, 13160, 56, 21323, 21323, 55, 34539, 34539, 56
OFFSET
0,3
MATHEMATICA
Hofstadter[n_Integer? Positive] := Hofstadter[n] = Hofstadter[n - Hofstadter[n - 1]] + Hofstadter[n - Hofstadter[n - 2]] Hofstadter[0] = Hofstadter[1] = 1; Hofstadter[2] = 2; Hofstadter[3] = 3; Hofstadter[4] = 3 a[n_Integer?Positive] := If[Mod[n, 3] == 0, a[n] = a[n - 1], If[Mod[n, 3] == 1, a[n] = Hofstadter[n - 2] + Hofstadter[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}]
CROSSREFS
Cf. A005185.
Sequence in context: A214674 A185332 A023818 * A321782 A104204 A131296
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Mar 15 2005
STATUS
approved