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.

A380024 a(n) = 4^n - 3^n - binomial(n,2)*3^(n-2).

Original entry on oeis.org

0, 1, 6, 28, 121, 511, 2152, 9094, 38563, 163729, 694282, 2934592, 12348541, 51697075, 215291356, 891989002, 3677964295, 15099277669, 61745907934, 251632677604, 1022414950465, 4143511249831, 16755357788176, 67628131638478, 272531374722091
Offset: 0

Views

Author

Enrique Navarrete, Feb 05 2025

Keywords

Comments

a(n) is the number of words of length n defined on 4 letters where one of the letters is used at least once but not twice.

Examples

			For n=2, the 6 words on {0, 1, 2, 3} that use 0 at least once but not twice are 10, 01, 20, 02, 30, 03.
		

Crossrefs

Programs

  • Mathematica
    Array[4^#-3^#-Binomial[#,2]*3^(#-2)&,25,0] (* or *) LinearRecurrence[{13,-63,135,-108},{0,1,6,28},25] (* James C. McMahon, Feb 14 2025 *)
  • Python
    def A380024(n): return (1<<(n<<1))-((n*(n-1)>>1)+9)*3**(n-2) if n>1 else n # Chai Wah Wu, Feb 14 2025

Formula

E.g.f.: exp(3*x)*(exp(x)-(x^2)/2-1).
G.f.: x*(1 - 7*x + 13*x^2)/((1 - 3*x)^3*(1 - 4*x)). - Stefano Spezia, Mar 03 2025