login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A085689 a(1) = 4; a(n) = if n == 2 mod 3 then a(n-1)/2, if n == 0 mod 3 then a(n-1)*2, if n == 1 mod 3 then a(n-1)*3. 0
4, 2, 4, 12, 6, 12, 36, 18, 36, 108, 54, 108, 324, 162, 324, 972, 486, 972, 2916, 1458, 2916, 8748, 4374, 8748, 26244, 13122, 26244, 78732, 39366, 78732, 236196, 118098, 236196, 708588, 354294, 708588, 2125764, 1062882, 2125764, 6377292, 3188646, 6377292, 19131876 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Given as a puzzle: find the next term after 4, 12, 6, 12, 36, 18, 36! Thanks to Farideh Firoozbakht and Zak Seidov for the solution.

LINKS

Table of n, a(n) for n=1..43.

Index entries for linear recurrences with constant coefficients, signature (0,0,3).

FORMULA

a[1] = 4; a[n] = (2 + Mod[n, 3])*8^(-Floor[(1 + Mod[n, 3])/3])*a[n - 1].

a(n) = 3^floor((n-1)/3) (4 - 2 floor((n mod 3)/2)). - Dean Hickerson, Jul 24, 2003

a(n) = 3*a(n-3). G.f.: -2*x*(2*x^2+x+2) / (3*x^3-1). - Colin Barker, Jul 31 2013

MAPLE

a := proc(n) option remember; if n=1 then 4; elif n mod 3 = 2 then a(n-1)/2 elif n mod 3 = 0 then a(n-1)*2 else a(n-1)*3; fi; end;

MATHEMATICA

a[1] = 4; a[n_] := Switch[ Mod[n, 3], 0, 2a[n - 1], 1, 3a[n - 1], 2, a[n - 1]/2]; Table[ a[n], {n, 1, 43}]

a[1] = 4; a[n_] := (2 + Mod[n, 3])*8^(-Floor[(1 + Mod[n, 3])/3])*a[n - 1] Do[Print[a[n], {n, 30}]

CROSSREFS

Sequence in context: A011382 A011302 A302603 * A134434 A261254 A168613

Adjacent sequences:  A085686 A085687 A085688 * A085690 A085691 A085692

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Jul 18 2003

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 October 23 19:37 EDT 2019. Contains 328373 sequences. (Running on oeis4.)