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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A079362 Sequence of sums of alternating powers of 3. 1
1, 4, 5, 14, 17, 44, 53, 134, 161, 404, 485, 1214, 1457, 3644, 4373, 10934, 13121, 32804, 39365, 98414, 118097, 295244, 354293, 885734, 1062881, 2657204, 3188645, 7971614, 9565937, 23914844, 28697813, 71744534, 86093441, 215233604 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

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

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

FORMULA

G.f.: x(1+3x-2x^2)/((1-x)(1-3x^2)). - Michael Somos, Feb 18 2003

For n >= 1, a(2n-1) = (2/3)*3^n - 1, a(2n) = (5/3)*3^n - 1. - Benoit Cloitre, Feb 16 2003

MAPLE

a[0]:=1:a[1]:=4:for n from 2 to 100 do a[n]:=3*a[n-2]+2 od: seq(a[n], n=0..33); # Zerinvary Lajos, Mar 17 2008

MATHEMATICA

LinearRecurrence[{1, 3, -3}, {1, 4, 5}, 40] (* Harvey P. Dale, Oct 18 2016 *)

PROG

(PARI) a(n)=if(n<1, 0, 1+sum(k=2, n, 3^((k\2)-(k%2))))

(PARI) a(n)=if(n<0, 0, (5/3-3*n%2)*2^ceil(n/2)-1)

CROSSREFS

Cf. A079360, A079363, A028242, A048473 (bisection).

Sequence in context: A191142 A049770 A262903 * A222364 A222372 A302348

Adjacent sequences:  A079359 A079360 A079361 * A079363 A079364 A079365

KEYWORD

easy,nonn

AUTHOR

Cino Hilliard, Feb 15 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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 15 04:00 EST 2018. Contains 317225 sequences. (Running on oeis4.)