|
|
A061981
|
|
a(n) = 3^n - 2*n - 1.
|
|
5
|
|
|
0, 0, 4, 20, 72, 232, 716, 2172, 6544, 19664, 59028, 177124, 531416, 1594296, 4782940, 14348876, 43046688, 129140128, 387420452, 1162261428, 3486784360, 10460353160, 31381059564, 94143178780, 282429536432, 847288609392
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
G.f.: 4*x^2/((1-3*x)*(1-x)^2).
a(n) = Sum_{j=2..n} Sum_{i=0..j} n!/((j-i)!*i!*(n-j)!).
a(n) = 4 + 4*a(n-1) - 3*a(n-2). (End)
E.g.f.: exp(3*x) - (2*x + 1)*exp(x). - G. C. Greubel, Jun 13 2022
|
|
MATHEMATICA
|
Table[3^n-2n-1, {n, 0, 30}] (* or *) LinearRecurrence[{5, -7, 3}, {0, 0, 4}, 30] (* Harvey P. Dale, Mar 30 2018 *)
|
|
PROG
|
(PARI) { for (n=0, 200, write("b061981.txt", n, " ", 3^n - 2*n - 1) ) } \\ Harry J. Smith, Jul 29 2009
(SageMath) [3^n -(2*n+1) for n in (0..40)] # G. C. Greubel, Jun 13 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|