OFFSET
1,2
COMMENTS
Considered as a vector, the sequence = A074909 * [1, 2, 3, ...], where A074909 is the beheaded Pascal's triangle as a matrix. - Gary W. Adamson, Mar 06 2012
a(n) is the sum of the upper left n X n subarray of A052509 (viewed as an infinite square array). For example (1+1+1) + (1+2+2) + (1+3+4) = 16. - J. M. Bergot, Nov 06 2012
Number of ternary strings of length n that contain at least one 2 and at most one 0. For example, a(3) = 16 since the strings are the 6 permutations of 201, the 3 permutations of 211, the 3 permutations of 220, the 3 permutations of 221, and 222. - Enrique Navarrete, Jul 25 2021
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..3311
Index entries for linear recurrences with constant coefficients, signature (6,-13,12,-4).
FORMULA
a(n) = (n+2)*2^(n-1)-n-1. - Vladeta Jovovic, Feb 28 2003
G.f.: -x*(-1+x+x^2) / ( (2*x-1)^2*(x-1)^2 ). - R. J. Mathar, Sep 02 2011
a(n) = (1/2) * Sum_{k=1..n} Sum_{i=1..n} C(k,i) + C(n,k). - Wesley Ivan Hurt, Sep 22 2017
E.g.f.: exp(x)*(exp(x)-1)*(1+x). - Enrique Navarrete, Jul 25 2021
a(n+1) = 2*a(n) + A006127(n). - Ya-Ping Lu, Jan 01 2024
EXAMPLE
a(4) = 4 + 7 + 12 + 20 = 43.
MAPLE
A053221 := proc(n) (n+2)*2^(n-1)-n-1 ; end proc: # R. J. Mathar, Sep 02 2011
MATHEMATICA
Table[(n + 2)*2^(n - 1) - n - 1, {n, 29}] (* or *)
Rest@ CoefficientList[Series[-x (-1 + x + x^2)/((2 x - 1)^2*(x - 1)^2), {x, 0, 29}], x] (* Michael De Vlieger, Sep 22 2017 *)
LinearRecurrence[{6, -13, 12, -4}, {1, 5, 16, 43}, 30] (* Harvey P. Dale, Jun 28 2021 *)
PROG
(PARI) vector(50, n, (n+2)*2^(n-1)-n-1) \\ G. C. Greubel, Sep 03 2018
(Magma) [(n+2)*2^(n-1)-n-1: n in [1..50]]; // G. C. Greubel, Sep 03 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Asher Auel, Jan 01 2000
STATUS
approved