login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A353094
a(1) = 2; for n > 1, a(n) = 3*a(n-1) + 3 - n.
7
2, 7, 21, 62, 184, 549, 1643, 4924, 14766, 44291, 132865, 398586, 1195748, 3587233, 10761687, 32285048, 96855130, 290565375, 871696109, 2615088310, 7845264912, 23535794717, 70607384131, 211822152372, 635466457094, 1906399371259, 5719198113753, 17157594341234
OFFSET
1,1
FORMULA
G.f.: x * (2 - 3*x)/((1 - x)^2 * (1 - 3*x)).
a(n) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3).
a(n) = A000340(n-1) + n.
a(n) = (3^(n+1) + 2*n - 3)/4.
a(n) = Sum_{k=0..n-1} (3 - n + k) * 3^k.
E.g.f.: exp(x)*(3*exp(2*x) + 2*x - 3)/4. - Stefano Spezia, May 28 2023
MATHEMATICA
LinearRecurrence[{5, -7, 3}, {2, 7, 21}, 28] (* Amiram Eldar, Apr 23 2022 *)
PROG
(PARI) my(N=30, x='x+O('x^N)); Vec(x*(2-3*x)/((1-x)^2*(1-3*x)))
(PARI) a(n) = (3^(n+1)+2*n-3)/4;
(PARI) b(n, k) = sum(j=0, n-1, (k-n+j)*k^j);
a(n) = b(n, 3);
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Apr 23 2022
STATUS
approved