A290990 p-INVERT of the nonnegative integers (A000027), where p(S) = 1 - S - S^2.
0, 1, 2, 5, 12, 28, 64, 145, 328, 743, 1686, 3830, 8704, 19781, 44950, 102133, 232048, 527208, 1197808, 2721421, 6183108, 14048151, 31917714, 72517738, 164761792, 374342057, 850512458, 1932380869, 4390407092, 9975090996, 22663602720, 51492150953
Offset: 0
Links
- Clark Kimberling, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (4,-5,2,1).
Programs
-
Magma
I:=[0,1,2,5]; [n le 4 select I[n] else 4*Self(n-1) -5*Self(n-2) +2*Self(n-3) +Self(n-4): n in [1..50]]; // G. C. Greubel, Apr 12 2023
-
Mathematica
z = 60; s = x^2/(1-x)^2; p = 1 -s -s^2; Drop[CoefficientList[Series[s, {x,0,z}], x], 1] (* A000027 *) Drop[CoefficientList[Series[1/p, {x,0,z}], x], 1] (* A290990 *) LinearRecurrence[{4,-5,2,1}, {0,1,2,5}, 50] (* G. C. Greubel, Apr 12 2023 *)
-
PARI
concat(0, Vec(x*(1-2*x+2*x^2)/(1-4*x+5*x^2-2*x^3-x^4) + O(x^50))) \\ Colin Barker, Aug 24 2017
-
SageMath
@CachedFunction def a(n): # a = A290990 if (n<4): return (0,1,2,5)[n] else: return 4*a(n-1) -5*a(n-2) +2*a(n-3) +a(n-4) [a(n) for n in range(51)] # G. C. Greubel, Apr 12 2023
Formula
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3) + a(n-4).
G.f.: x*(1 - 2*x + 2*x^2) / (1 - 4*x + 5*x^2 - 2*x^3 - x^4). - Colin Barker, Aug 24 2017
Comments