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.

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

This page as a plain text file.
%I A387012 #14 Aug 26 2025 05:58:01
%S A387012 0,4,48,496,4864,46464,436992,4068096,37601280,345733120,3166363648,
%T A387012 28910051328,263320698880,2393742770176,21726260035584,
%U A387012 196938517118976,1783247797223424,16132649384411136,145839570932465664,1317564543167102976,11896996193604993024,107375816824319901696
%N A387012 Number of ternary strings of length 2*n that have fewer 0's than the combined number of 1's and 2's.
%F A387012 a(n) = 9^n - Sum_{k=0..n} 2^(n-k)*binomial(2*n,n-k).
%F A387012 G.f.: (sqrt(1-8*x)*(sqrt(1-8*x)+12*x-1)-8*x*(1-9*x))/((1-9*x)*sqrt(1-8*x)*(sqrt(1-8*x)+12*x-1)).
%F A387012 a(n) = A001019(n) - A128418(n).
%F A387012 D-finite with recurrence n*a(n) +(-29*n+28)*a(n-1) +12*(23*n-41)*a(n-2) +432*(-2*n+5)*a(n-3)=0. - _R. J. Mathar_, Aug 26 2025
%e A387012 a(2) = 48 since the strings of length 4 are the following (number of permutations in parentheses): 1110 (4), 1120 (12), 1220 (12), 2220 (4), 1111 (1), 1112 (4), 1122 (6), 1222 (4), 2222 (1).
%t A387012 a[n_] := 9^n - Sum[2^(n-k) * Binomial[2*n, n-k], {k, 0, n}]; Array[a, 22, 0] (* _Amiram Eldar_, Aug 16 2025 *)
%Y A387012 Cf. A001019, A128418, A385252.
%K A387012 nonn,new
%O A387012 0,2
%A A387012 _Enrique Navarrete_, Aug 12 2025