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-3 of 3 results.

A177251 Number of permutations of [n] having no adjacent 3-cycles, i.e., no cycles of the form (i, i+1, i+2).

Original entry on oeis.org

1, 1, 2, 5, 22, 114, 697, 4923, 39612, 357899, 3588836, 39556420, 475392841, 6187284605, 86701097310, 1301467245329, 20835850494474, 354382860600678, 6381494425302865, 121290065781743383, 2426510081356069016, 50969474697328055063, 1121571023472780698152
Offset: 0

Views

Author

Emeric Deutsch, May 07 2010

Keywords

Examples

			a(4)=22 because the only permutations of {1,2,3,4} having adjacent 3-cycles are (123)(4) and (1)(234).
		

Crossrefs

Programs

  • Magma
    A177251:= func< n | (&+[(-1)^j*Factorial(n-2*j)/Factorial(j): j in [0..Floor(n/3)]]) >;
    [A177251(n): n in [0..30]]; // G. C. Greubel, Apr 28 2024
    
  • Maple
    a := proc (n) options operator, arrow: sum((-1)^j*factorial(n-2*j)/factorial(j), j = 0 .. floor((1/3)*n)) end proc: seq(a(n), n = 0 .. 22);
  • Mathematica
    a[n_] := Sum[(-1)^j*(n - 2*j)!/j!, {j, 0, n/3}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 17 2017 *)
  • SageMath
    def A177251(n): return sum((-1)^j*factorial(n-2*j)/factorial(j) for j in range(1+n//3))
    [A177251(n) for n in range(31)] # G. C. Greubel, Apr 28 2024

Formula

a(n) = Sum_{j=0..floor(n/3)} (-1)^j*(n-2*j)!/j!.
a(n) = A177250(n,0).
a(n) - n*a(n-1) = 2*a(n-3) + 3*(-1)^(n/3) if 3 | n, otherwise a(n) - n*a(n-1) = 2*a(n-3).
lim_{n -> oo} a(n)/n! = 1.
The o.g.f. g(z) satisfies z^2*(1+z^3)*g'(z) - (1+z^3)(1-z-2z^3)g(z) + 1 - 2z^3 = 0; g(0)=1.
G.f.: hypergeometric2F0([1,1], [], x/(1+x^3))/(1+x^3). - Mark van Hoeij, Nov 08 2011
D-finite with recurrence a(n) = n*a(n-1) + a(n-3) + (n-3)*a(n-4) + 2*a(n-6). - R. J. Mathar, Jul 26 2022
G.f.: Sum_{k>=0} k! * x^k / (1+x^3)^(k+1). - Seiichi Manyama, Feb 20 2024

Extensions

Crossreferences corrected by Emeric Deutsch, May 09 2010

A370324 Number of derangements of [n] having no adjacent 2-cycles, no adjacent 3-cycles, no adjacent 4-cycles and no adjacent 5-cycles.

Original entry on oeis.org

1, 0, 0, 1, 6, 34, 217, 1567, 12842, 117704, 1193802, 13280778, 160843345, 2107036346, 29689965966, 447822830067, 7199604972876, 122907451783308, 2220526880775841, 42328779624824103, 849065324387063412, 17877539166289948864, 394246737752465047380
Offset: 0

Views

Author

Seiichi Manyama, Feb 22 2024

Keywords

Crossrefs

Programs

  • PARI
    my(N=30, x='x+O('x^N)); Vec(sum(k=0, N, k!*x^k*((1-x)/(1-x^6))^(k+1)))

Formula

G.f.: Sum_{k>=0} k! * x^k * ( (1-x)/(1-x^6) )^(k+1).
a(n) = Sum_{i, j, k, l, m>=0 and i+2*j+3*k+4*l+5*m<=n} (-1)^(i+j+k+l+m) * (n-j-2*k-3*l-4*m)!/(i!*j!*k!*l!*m!).

A370570 Number of permutations of [n] having no adjacent 2-cycles and no adjacent 3-cycles.

Original entry on oeis.org

1, 1, 1, 3, 17, 95, 594, 4280, 35018, 320636, 3249951, 36140133, 437572800, 5731086422, 80745062993, 1217782176949, 19576722067015, 334183547442139, 6037316140379389, 115082343658784617, 2308352556410956084, 48602560660569621128, 1071794851776260190000
Offset: 0

Views

Author

Seiichi Manyama, Feb 22 2024

Keywords

Crossrefs

Cf. A370569.

Programs

  • PARI
    my(N=30, x='x+O('x^N)); Vec(sum(k=0, N, k!*x^k/(1+x^2+x^3)^(k+1)))

Formula

G.f.: Sum_{k>=0} k! * x^k / (1+x^2+x^3)^(k+1).
a(n) = Sum_{i, j>=0 and 2*i+3*j<=n} (-1)^(i+j) * (n-i-2*j)!/(i!*j!).
Showing 1-3 of 3 results.