login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A122164 a(0) = 0, a(1) = 1, s = 0; for n >= 2, if a(n-1) is even and s = 0 then set a(n) = a(n-1)/2 and s = 1; otherwise set a(n) = a(n-1) + a(n-2) and s = 0. 2
0, 1, 1, 2, 1, 3, 4, 2, 6, 3, 9, 12, 6, 18, 9, 27, 36, 18, 54, 27, 81, 108, 54, 162, 81, 243, 324, 162, 486, 243, 729, 972, 486, 1458, 729, 2187, 2916, 1458, 4374, 2187, 6561, 8748, 4374, 13122, 6561, 19683, 26244, 13122, 39366, 19683, 59049, 78732, 39366 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Harvey P. Dale, Table of n, a(n) for n = 0..1000

FORMULA

For i >= 1, a(5i) = 3^i, a(5i+1) = 4*3^(i-1), a(5i+2) = 2*3^(i-1), a(5i+3) = 2*3^i, a(5i+4) = 3^i. - N. J. A. Sloane, Aug 06 2008

O.g.f.: x(-1-x-2x^2-x^3-3x^4-x^5+x^6)/(3x^5-1). - R. J. Mathar, Aug 07 2008

MATHEMATICA

Do[a[n] = {0, 1, 1, 2, 1, 3, 4, 2}[[n+1]], {n, 0, 7}]; a[n_] := a[n] = 3*a[n-5]; Array[a, 53, 0] (* Jean-Fran├žois Alcover, Nov 07 2016 *)

nxt[{s_, a_, b_}]:=If[EvenQ[b]&&s==0, {1, b, b/2}, {0, b, a+b}]; NestList[nxt, {0, 0, 1}, 60][[All, 2]] (* Harvey P. Dale, Oct 25 2020 *)

CROSSREFS

Cf. A000045, A122597. Records give A000792.

Sequence in context: A209125 A209137 A269752 * A210793 A281715 A076632

Adjacent sequences:  A122161 A122162 A122163 * A122165 A122166 A122167

KEYWORD

nonn

AUTHOR

Philip van den Bossche (filip020667(AT)hotmail.com), Aug 03 2008

EXTENSIONS

Edited by N. J. A. Sloane, Aug 06 2008

Extended by R. J. Mathar, Aug 07 2008

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 21 18:50 EDT 2021. Contains 345365 sequences. (Running on oeis4.)