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.

Showing 1-1 of 1 results.

A385726 a(n) = 3^n - 6*binomial(n,4) - 6*binomial(n,3) - 4*binomial(n,2) - 2*n - 1.

Original entry on oeis.org

0, 0, 0, 2, 18, 102, 446, 1668, 5676, 18260, 59049, 177147, 531441, 1594323, 4782969, 14348907, 43046721, 129140163, 387420489, 1162261467, 3486784401, 10460353203, 31381059609, 94143178827, 282429536481, 847288609443, 2541865828329, 7625597484987, 22876792454961, 68630377364883
Offset: 0

Views

Author

Enrique Navarrete, Jul 08 2025

Keywords

Comments

a(n) is the number of ternary strings of length n that contain at least three 1's or at least three 2's (or both).

Examples

			a(3)= 2 since the strings are 111 and 222.
a(4) = 18 since the strings are (number of permutations in parentheses): 1111 (1), 1112 (4), 1110 (4), 1222 (4), 0222 (4), 2222 (1).
		

Crossrefs

Formula

E.g.f.: exp(x)*(exp(2*x)-(1 + x + x^2/2)^2).
a(n) = 3^n - A385689(n).
G.f.: x^3*(2 + 12*x + 48*x^2 + 140*x^3 + 330*x^4 + 672*x^5 + 1232*x^6 + 4269*x^7)/(1 - 3*x). - Stefano Spezia, Jul 08 2025
Showing 1-1 of 1 results.