A387185 a(n) = n*2^(n-1) + binomial(n,2)*2^(n-2) + binomial(n,3)*2^(n-3).
0, 1, 5, 19, 64, 200, 592, 1680, 4608, 12288, 32000, 81664, 204800, 505856, 1232896, 2969600, 7077888, 16711680, 39124992, 90898432, 209715200, 480772096, 1095761920, 2484076544, 5603590144, 12582912000, 28135391232, 62662901760, 139049566208, 307492814848, 677799526400
Offset: 0
Examples
a(3) = 19 since the words are (number of permutations in parentheses): add (3), ade (6), aee (3), bbd (3), bbe (3), ccc (1). a(4) = 64 since from the 81 strings of length 4 we subtract the following 17 (number of permutations in parentheses): 0000 (1), 1111 (1), 1112 (4), 1122 (6), 1222 (4), 2222 (1).
Links
- Index entries for linear recurrences with constant coefficients, signature (8,-24,32,-16).
Programs
-
Mathematica
a[n_] := Sum[2^(n-k)*Binomial[n, k], {k, 1, 3}]; Array[a, 30, 0] (* Amiram Eldar, Aug 21 2025 *)
Formula
E.g.f.: (1 + x/2 + x^2/6)*x*exp(2*x).
G.f.: x*(1-3*x+3*x^2)/(2*x-1)^4 . - R. J. Mathar, Aug 26 2025
a(n) = n*2^n*(20+3*n+n^2)/48. - R. J. Mathar, Aug 26 2025
Comments