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 A381643 #11 Mar 15 2025 11:54:50 %S A381643 0,0,0,3,34,245,1436,7483,36198,166545,739792,3203783,13617242, %T A381643 57072925,236680068,973578003,3979881166,16191039785,65622734264, %U A381643 265197899743,1069304363970,4303927449525,17299346486380,69458798306603,278650899449654 %N A381643 a(n) = 4^n - (n+6)*3^(n-1) + (n+2)*2^(n-1). %C A381643 a(n) is the number of words of length n defined on a 4-letter alphabet where one of the letters is used at least twice and another letter is used at least once. %H A381643 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (14,-77,208,-276,144). %F A381643 E.g.f.: (exp(x)-x-1)*(exp(3*x)-exp(2*x)). %F A381643 G.f.: x^3*(3 - 8*x)/((1 - 4*x)*(1 - 5*x + 6*x^2)^2). - _Stefano Spezia_, Mar 07 2025 %e A381643 For n=4 the 34 words that use 0 at least twice and 1 at least once are 0001 (4 of this type), 0011 (6 of this type), 0012 (12 of this type), 0013 (12 of this type). %o A381643 (Python) %o A381643 def A381643(n): return ((1<<n+1)+n+2<<n-1)-(n+6)*3**(n-1) if n else 0 # _Chai Wah Wu_, Mar 15 2025 %Y A381643 Cf. A309000, A381646. %K A381643 nonn,easy %O A381643 0,4 %A A381643 _Enrique Navarrete_, Mar 03 2025