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!)
A037488 Base 3 digits are, in order, the first n terms of the periodic sequence with initial period 2,1. 0
2, 7, 23, 70, 212, 637, 1913, 5740, 17222, 51667, 155003, 465010, 1395032, 4185097, 12555293, 37665880, 112997642, 338992927, 1016978783, 3050936350, 9152809052, 27458427157, 82375281473, 247125844420, 741377533262 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3).
G.f.: x*(2+x)/((1-x^2)*(1-3*x)). - Michael Somos, Sep 28 2002
a(n) = (7*3^n-(-1)^n-6)/8. - Bruno Berselli, Jan 20 2011
MATHEMATICA
Module[{nn=30, c}, c=PadRight[{}, nn, {2, 1}]; Table[FromDigits[Take[c, n], 3], {n, nn}]] (* or *) LinearRecurrence[{3, 1, -3}, {2, 7, 23}, 30] (* Harvey P. Dale, May 21 2015 *)
PROG
(PARI) a(n)=if(n<1, 0, 3*a(n-1)+1+n%2)
(PARI) a(n)=if(n<1, 0, 3^n*7\8)
CROSSREFS
Sequence in context: A048496 A369840 A210581 * A129669 A037568 A076656
KEYWORD
nonn,base,easy
AUTHOR
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 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)