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.

Showing 1-2 of 2 results.

A381646 a(n) = 4^n - 2*3^(n-1)*(n+3) + 2^(n-2)*(n^2+3*n+4).

Original entry on oeis.org

0, 0, 0, 0, 6, 80, 650, 4172, 23310, 119016, 571122, 2621828, 11651222, 50536928, 215219706, 903799548, 3754755102, 15469272536, 63320624642, 257886717812, 1046169235110, 4230947198160, 17069749295370, 68738191563500, 276393979740206
Offset: 0

Views

Author

Enrique Navarrete, Mar 03 2025

Keywords

Comments

a(n) is the number of words of length n defined on 4 letters where two of the letters are used at least twice.

Examples

			For n=5 the 80 words that use 0 and 1 at least twice are 00111 (10 of this type), 00011 (10 of this type), 00112 (30 of this type), 00113 (30 of this type).
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{16,-105,362,-692,696,-288},{0,0,0,0,6,80},25] (* Stefano Spezia, Mar 03 2025 *)
  • Python
    def A381646(n): return ((1<2 else 0 # Chai Wah Wu, Mar 15 2025

Formula

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

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

Original entry on oeis.org

1, 4, 15, 55, 202, 754, 2881, 11281, 45124, 183412, 753331, 3111739, 12879982, 53291398, 220074325, 906337909, 3721011016, 15228417832, 62133328423, 252794939071, 1025901734866, 4153971603034, 16786738847785, 67722274817305, 272813804258572
Offset: 0

Views

Author

Enrique Navarrete, Feb 06 2025

Keywords

Comments

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.

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{13,-63,135,-108},{1,4,15,55},25] (* Stefano Spezia, Mar 03 2025 *)
  • Python
    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

Formula

E.g.f.: exp(3*x)*(exp(x)-(x^2)/2).
G.f.: (1 - 9*x + 26*x^2 - 23*x^3)/((1 - 3*x)^3*(1 - 4*x)). - Stefano Spezia, Mar 03 2025
Showing 1-2 of 2 results.