A072176 Unimodal analog of Fibonacci numbers: a(n+1) = Sum_{k=0..floor(n/2)} A071922(n-k,k).
1, 1, 2, 3, 5, 9, 16, 30, 56, 106, 201, 382, 727, 1384, 2636, 5021, 9565, 18222, 34715, 66137, 126001, 240052, 457338, 871304, 1659978, 3162533, 6025150, 11478911, 21869232, 41664520, 79377833, 151227961, 288114394, 548905795
Offset: 1
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2,-1,1).
Programs
-
GAP
a:=[1,1,2,3,5];; for n in [6..40] do a[n]:=2*a[n-1]+a[n-2] -2*a[n-3]-a[n-4]+a[n-5]; od; a; # G. C. Greubel, Aug 26 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 40); Coefficients(R!( x*(1-x-x^2)/((1-x)*(1-x-2*x^2+x^4)) )); // G. C. Greubel, Aug 26 2019 -
Maple
seq(coeff(series(x*(1-x-x^2)/((1-x)*(1-x-2*x^2+x^4)), x, n+1), x, n), n = 1..40); # G. C. Greubel, Aug 26 2019
-
Mathematica
Rest@CoefficientList[ Series[x(1-x-x^2)/((1-x)(1-x-2x^2+x^4)), {x, 0, 40}], x] (* or *) LinearRecurrence[{2,1,-2,-1,1}, {1,1,2,3,5}, 40] (* Harvey P. Dale, Jun 23 2011 *)
-
PARI
my(x='x+O('x^40)); Vec(x*(1-x-x^2)/((1-x)*(1-x-2*x^2+x^4))) \\ G. C. Greubel, Aug 26 2019
-
Sage
def A072176_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P( x*(1-x-x^2)/((1-x)*(1-x-2*x^2+x^4)) ).list() a=A072176_list(40); a[1:] # G. C. Greubel, Aug 26 2019
Formula
G.f.: x*(1-x-x^2)/((1-x)*(1-x-2*x^2+x^4)).
a(1)=1, a(2)=1, a(3)=2, a(4)=3, a(5)=5, a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). - Harvey P. Dale, Jun 23 2011
Comments