cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A387185 a(n) = n*2^(n-1) + binomial(n,2)*2^(n-2) + binomial(n,3)*2^(n-3).

Original entry on oeis.org

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

Views

Author

Enrique Navarrete, Aug 21 2025

Keywords

Comments

Number of ternary strings of length n that contain one, two or three 0's.
Number of words of length n defined on five letters that contain one a or 2 b's or 3 c's and any number of d's and e's.

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).
		

Crossrefs

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