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.
%I A380249 #19 Mar 15 2025 12:31:26 %S A380249 1,4,15,55,202,754,2881,11281,45124,183412,753331,3111739,12879982, %T A380249 53291398,220074325,906337909,3721011016,15228417832,62133328423, %U A380249 252794939071,1025901734866,4153971603034,16786738847785,67722274817305,272813804258572 %N A380249 a(n) = 4^n - binomial(n,2)*3^(n-2). %C A380249 a(n) is the number of words of length n defined on 4 letters where one of the letters is not used or is used any number of times except twice. %H A380249 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (13,-63,135,-108). %F A380249 E.g.f.: exp(3*x)*(exp(x)-(x^2)/2). %F A380249 G.f.: (1 - 9*x + 26*x^2 - 23*x^3)/((1 - 3*x)^3*(1 - 4*x)). - _Stefano Spezia_, Mar 03 2025 %e A380249 For n=2, the 15 words on {0, 1, 2, 3} that do not use 0 exactly twice are 12, 21, 13, 31, 23, 32, 11, 22, 33, 10, 01, 20, 02, 30, 03. %t A380249 LinearRecurrence[{13,-63,135,-108},{1,4,15,55},25] (* _Stefano Spezia_, Mar 03 2025 *) %o A380249 (Python) %o A380249 def A380249(n): return (1<<(n<<1))-(3**(n-2)*n*(n-1)>>1 if n>1 else 0) # _Chai Wah Wu_, Mar 15 2025 %Y A380249 Cf. A086443, A380651, A380024. %K A380249 nonn,easy %O A380249 0,2 %A A380249 _Enrique Navarrete_, Feb 06 2025