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 (4,-5,2).
FORMULA
Binomial transform of [1, 3, 2, 4, 2, 4, 2, 4, ...].
From G. C. Greubel, Oct 21 2017: (Start)
a(n) = 3*2^(n-1) - n, for n >= 2.
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
G.f.: x*(1 - 2*x^2 + 2*x^3)/((1-2*x)*(1-x)^2).
E.g.f.: (3*exp(2*x) - 2*x*exp(x) - 2*x - 3)/2. (End)
a(n) = A123720(n) for n >= 2. - Georg Fischer, Nov 02 2018
EXAMPLE
a(4) = 20 = sum of row 4 terms of triangle A133094: (7 + 7 + 5 + 1).
a(4) = 20 = (1, 3, 3, 1) dot (1, 3, 2, 4) = (1 + 9 + 6 + 4).
MATHEMATICA
Join[{1}, Table[ 3*2^(n - 1) - n, {n, 2, 50}]] (* G. C. Greubel, Oct 21 2017 *)
LinearRecurrence[{4, -5, 2}, {1, 4, 9, 20}, 50] (* Harvey P. Dale, Aug 09 2022 *)
PROG
(PARI) concat(1, for(n=1, 50, print1(3*2^(n - 1) - n, ", "))) \\ G. C. Greubel, Oct 21 2017
(Magma) [1] cat [3*2^(n - 1) - n: n in [2..50]]; // G. C. Greubel, Oct 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Sep 09 2007
EXTENSIONS
Terms a(11) onward added by G. C. Greubel, Oct 21 2017
STATUS
approved