A136408 a(n) = 3*a(n-1) - 4*a(n-2) + 6*a(n-3) - 4*a(n-4), with initial terms 1,2,4,7.
1, 2, 4, 7, 13, 27, 55, 107, 211, 427, 859, 1707, 3403, 6827, 13675, 27307, 54571, 109227, 218539, 436907, 873643, 1747627, 3495595, 6990507, 13980331, 27962027, 55925419, 111848107, 223693483, 447392427, 894790315, 1789569707, 3579128491
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,-4,6,-4).
Crossrefs
Cf. A077966.
Programs
-
Magma
[(5*2^n +2 -((n+1) mod 2)*(-2)^Floor((n+1)/2))/6: n in [0..40]]; // G. C. Greubel, Jan 19 2023
-
Mathematica
LinearRecurrence[{3,-4,6,-4},{1,2,4,7},41] (* Harvey P. Dale, Aug 12 2016 *)
-
PARI
a(n)=(5<
Charles R Greathouse IV, Mar 30 2022 -
SageMath
[(5*2^n +2 -((n+1)%2)*(-2)^((n+1)//2))/6 for n in range(41)] # G. C. Greubel, Jan 19 2023
Formula
From R. J. Mathar, Apr 04 2008: (Start)
O.g.f.: (1 - x + 2*x^2 - 3*x^3)/((1-x)*(1-2*x)*(1+2*x^2)).
a(n) = (5*2^n + 2 - A077966(n))/6. (End)
Extensions
More terms from R. J. Mathar, Apr 04 2008