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.

A386670 Number of ternary strings of length 2*n that have more 0's than the combined number of 1's and 2's.

Original entry on oeis.org

0, 1, 9, 73, 577, 4521, 35313, 275577, 2150721, 16793929, 131230609, 1026283545, 8032614625, 62921342953, 493262044977, 3869724080313, 30379987189377, 238661880787593, 1876072096450257, 14756076838714713, 116126703647975457, 914363729294862633, 7203083947383222897
Offset: 0

Views

Author

Enrique Navarrete, Jul 28 2025

Keywords

Examples

			a(1)=1 since the string of length 2 is 00.
a(2)=9 since the strings of length 4 are the 4 permutations of 0001, the 4 permutations of 0002, and 0000.
a(4)=577 since the strings of length 8 are (number of permutations in parentheses): 00000001 (8), 00000002 (8), 00000011 (28), 00000012 (56), 00000022 (28), 00000111 (56), 00000112 (168), 00000122 (168), 00000222 (56), 00000000 (1).
		

Crossrefs

Formula

a(n) = Sum_{k=1..n} 2^(n-k)*binomial(2*n,n-k).
a(n) = Sum_{k=1..n} A128417(n,k).
G.f.: (1-4*x-sqrt(1-8*x))/(sqrt(1-8*x)*(sqrt(1-8*x)+12*x-1)).
a(n) = A128418(n) - A059304(n).