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!)
A129772 a(0) = 1, a(1) = 2; for n > 0, a(2n) = 3a(2n-1), a(2n+1) = 3a(2n) - 2a(n-1). 2
1, 2, 6, 16, 48, 140, 420, 1248, 3744, 11200, 33600, 100704, 302112, 906056, 2718168, 8153664, 24460992, 73380480, 220141440, 660416832, 1981250496, 5943729088, 17831187264, 53493494592, 160480483776, 481441249920, 1444323749760 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MAPLE
a[0]:=1: a[1]:=2: for n from 2 to 30 do if n mod 2 = 0 then a[n]:=3*a[n-1] else a[n]:=3*a[n-1]-2*a[(n-3)/2] fi od: seq(a[n], n=0..30); # Emeric Deutsch, May 22 2007
MATHEMATICA
a[0] = 1; a[1] = 2; a[n_] := If[OddQ@n, 3 a[n - 1] - 2 a[(n - 3)/2], 3 a[n - 1]]; Table[ a[n], {n, 0, 26}] (* Robert G. Wilson v *)
PROG
(PARI) {m=26; v=vector(m+1); v[1]=1; v[2]=2; for(n=2, m, k=3*v[n]; if(n%2==1, k=k-2*v[(n-1)/2]); v[n+1]=k); print(v)} /* Klaus Brockhaus, May 20 2007 */
CROSSREFS
Cf. A129770.
Sequence in context: A151281 A045694 A225178 * A360856 A046721 A230929
KEYWORD
nonn
AUTHOR
Paul Curtz, May 16 2007
EXTENSIONS
More terms from Emeric Deutsch, Robert G. Wilson v and Klaus Brockhaus, May 16 2007
STATUS
approved

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 April 19 15:11 EDT 2024. Contains 371794 sequences. (Running on oeis4.)