OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2).
FORMULA
a(n) = 7*(2^(n-3) + 1) if n >= 6. - Hagen von Eitzen, Jun 02 2009
From Colin Barker, Sep 15 2013: (Start)
a(n) = 3*a(n-1) - 2*a(n-2), for n >= 8.
G.f.: x*(1-2*x^2)*(1+2*x^2+4*x^4) / ((1-x)*(1-2*x)). (End)
E.g.f.: (7/8)*(8*exp(x) + exp(2*x)) - (1/8)*(63 + 62*x + 30*x^2) - 7*x^3/6 - x^4/4 - x^5/30. - G. C. Greubel, Oct 25 2022
MATHEMATICA
Join[{1, 3, 7, 15, 31}, 7*(1+2^(Range[6, 40] -3))] (* G. C. Greubel, Oct 25 2022 *)
PROG
(PARI) Vec(-x*(2*x^2-1)*(4*x^4+2*x^2+1)/((x-1)*(2*x-1)) + O(x^100)) \\ Colin Barker, Sep 15 2013
(Magma) [1, 3, 7, 15, 31] cat [7*(1+2^(n-3)): n in [6..40]]; // G. C. Greubel, Oct 25 2022
(SageMath)
def A147596(n): return 7*(1+2^(n-3)) -(1/8)*(63*int(n==0) +62*int(n==1) +60*int(n ==2)) -(7*int(n==3) +6*int(n==4) +4*int(n==5))
[A147596(n) for n in range(1, 40)] # G. C. Greubel, Oct 25 2022
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Omar E. Pol, Nov 08 2008
EXTENSIONS
More terms from Hagen von Eitzen, Jun 02 2009
STATUS
approved