A385252 Number of ternary strings of length 2*n that have at least one 0 but less 0's than the combined number of 1's and 2's.
0, 0, 32, 432, 4608, 45440, 432896, 4051712, 37535744, 345470976, 3165315072, 28905857024, 263303921664, 2393675661312, 21725991600128, 196937443377152, 1783243502256128, 16132632204541952, 145839502212988928, 1317564268289196032, 11896995094093365248, 107375812426273390592
Offset: 0
Keywords
Examples
a(2)=32 since the strings of length 4 are (number of permutations in parentheses): 1110 (4), 1120 (12), 1220 (12), 2220 (4). a(3)=432 since the strings of length 6 are (number of permutations in parentheses): 111110 (6), 111120 (30), 111220 (60), 112220 (60), 122220 (30), 222220 (6), 001111 (15), 001112 (60), 001122 (90), 001222 (60), 002222 (15).
Programs
-
Mathematica
a[0]=0; a[n_]:=9^n - 4^n - Sum[2^(n-k)*Binomial[2n,n-k],{k,0,n}]; Array[a,22,0] (* Stefano Spezia, Jul 31 2025 *)
Formula
a(n) = 9^n - 4^n - Sum_{k=0..n} 2^(n-k)*C(2*n,n-k) for n > 0.
G.f.: (5*x*(sqrt(1-8*x))*(sqrt(1-8*x)+12*x-1)-8*x*(36*x^2-13*x+1))/(sqrt(1-8*x)*(sqrt(1-8*x)+12*x-1)*(36*x^2-13*x+1)) + 1.
Conjecture D-finite with recurrence n*a(n) +(-37*n+36)*a(n-1) +4*(131*n-245)*a(n-2) +16*(-221*n+605)*a(n-3) +192*(59*n-213)*a(n-4) +6912*(-2*n+9)*a(n-5)=0. - R. J. Mathar, Jul 31 2025
a(n) = 9^n - 4^n - 2^n*binomial(2*n, n)*hypergeom([1, -n], [1+n], -1/2) for n > 0. - Stefano Spezia, Aug 05 2025