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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A152718 a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - a(n-4) + a(n-5), n > 5. 2
1, 1, 1, 1, 2, 4, 8, 16, 31, 60, 117, 228, 444, 865, 1685, 3282, 6393, 12453, 24257, 47250, 92038, 179280, 349218, 680239, 1325032, 2581019, 5027546, 9793116, 19075931, 37157851, 72379476, 140987393, 274628197, 534946033, 1042017030, 2029736504, 3953707240 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

Conjecture: this is the inverse Motzkin transform of A054393.

LINKS

G. C. Greubel, Table of n, a(n) for n = 0..3435

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

FORMULA

a(n)=1, n < 4. a(4)=2, a(5)=4. a(n) = 2*a(n-1) - a(n-2) + 2a(n-3) - a(n-4) + a(n-5), n > 5.

G.f.: 1 + x*(-1 + x + x^3)/(-1 + 2*x - x^2 + 2*x^3 - x^4 + x^5). - R. J. Mathar, May 26 2016

MAPLE

a:= n-> `if`(n=0, 1, (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>,

       <0|0|0|0|1>, <1|-1|2|-1|2>>^n. <<0, 1, 1, 1, 2>>)[1$2]):

seq(a(n), n=0..40);  # Alois P. Heinz, Nov 08 2016

MATHEMATICA

Join[{1}, LinearRecurrence[{2, -1, 2, -1, 1}, {1, 1, 1, 2, 4}, 50]] (* G. C. Greubel, Sep 01 2018 *)

PROG

(PARI) a(n) = {if (n==0, return(1)); if (n==1, return(1)); if (n==2, return(1)); if (n==3, return(1)); if (n==4, return(2)); if (n==5, return(4)); return (2*a(n-1)-a(n-2)+2*a(n-3)-a(n-4)+a(n-5)); } \\ Michel Marcus, Jul 23 2013

(PARI) x='x+O('x^50); Vec(1 + x*(-1+x+x^3)/(-1+2*x-x^2+2*x^3-x^4+x^5)) \\ G. C. Greubel, Sep 01 2018

(MAGMA) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(1 + x*(-1+x+x^3)/(-1+2*x-x^2+2*x^3-x^4+x^5))); // G. C. Greubel, Sep 01 2018

CROSSREFS

Sequence in context: A210021 A226188 A239556 * A006775 A104993 A223940

Adjacent sequences:  A152715 A152716 A152717 * A152719 A152720 A152721

KEYWORD

easy,nonn

AUTHOR

R. J. Mathar, Dec 11 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 October 15 04:33 EDT 2019. Contains 328026 sequences. (Running on oeis4.)