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.

A346085 Number T(n,k) of permutations of [n] such that k is the GCD of the cycle lengths; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 4, 0, 2, 0, 15, 3, 0, 6, 0, 96, 0, 0, 0, 24, 0, 455, 105, 40, 0, 0, 120, 0, 4320, 0, 0, 0, 0, 0, 720, 0, 29295, 4725, 0, 1260, 0, 0, 0, 5040, 0, 300160, 0, 22400, 0, 0, 0, 0, 0, 40320, 0, 2663199, 530145, 0, 0, 72576, 0, 0, 0, 0, 362880
Offset: 0

Views

Author

Alois P. Heinz, Jul 04 2021

Keywords

Examples

			T(3,1) = 4: (1)(23), (13)(2), (12)(3), (1)(2)(3).
T(4,4) = 6: (1234), (1243), (1324), (1342), (1423), (1432).
Triangle T(n,k) begins:
  1;
  0,       1;
  0,       1,      1;
  0,       4,      0,     2;
  0,      15,      3,     0,    6;
  0,      96,      0,     0,    0,    24;
  0,     455,    105,    40,    0,     0, 120;
  0,    4320,      0,     0,    0,     0,   0, 720;
  0,   29295,   4725,     0, 1260,     0,   0,   0, 5040;
  0,  300160,      0, 22400,    0,     0,   0,   0,    0, 40320;
  0, 2663199, 530145,     0,    0, 72576,   0,   0,    0,     0, 362880;
  ...
		

Crossrefs

Columns k=0-1 give: A000007, A079128.
Even bisection of column k=2 gives A346086.
Row sums give A000142.
T(2n,n) gives A110468(n-1) for n >= 1.

Programs

  • Maple
    b:= proc(n, g) option remember; `if`(n=0, x^g, add((j-1)!
          *b(n-j, igcd(g, j))*binomial(n-1, j-1), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
    seq(T(n), n=0..12);
  • Mathematica
    b[n_, g_] := b[n, g] = If[n == 0, x^g, Sum[(j - 1)!*
         b[n - j, GCD[g, j]] Binomial[n - 1, j - 1], {j, n}]];
    T[n_] := CoefficientList[b[n, 0], x];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)

Formula

Sum_{k=1..n} k * T(n,k) = A346066(n).
Sum_{prime p <= n} T(n,p) = A359951(n). - Alois P. Heinz, Jan 20 2023

A359951 Number of permutations of [n] such that the GCD of the cycle lengths is a prime.

Original entry on oeis.org

0, 0, 1, 2, 3, 24, 145, 720, 4725, 22400, 602721, 3628800, 67692625, 479001600, 12924021825, 103953833984, 2116670180625, 20922789888000, 959231402754625, 6402373705728000, 257071215652932681, 3242340687872000000, 142597230222616430625, 1124000727777607680000
Offset: 0

Views

Author

Alois P. Heinz, Jan 19 2023

Keywords

Examples

			a(2) = 1: (12).
a(3) = 2: (123), (132).
a(4) = 3: (12)(34), (13)(24), (14)(23).
a(5) = 24: (12345), (12354), (12435), (12453), (12534), (12543), (13245), (13254), (13425), (13452), (13524), (13542), (14235), (14253), (14325), (14352), (14523), (14532), (15234), (15243), (15324), (15342), (15423), (15432).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, g) option remember; `if`(n=0, `if`(isprime(g), 1, 0),
          add(b(n-j, igcd(j, g))*(n-1)!/(n-j)!, j=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..23);
  • Mathematica
    b[n_, g_] := b[n, g] = If[n == 0, If[PrimeQ[g], 1, 0], Sum[b[n - j, GCD[j, g]]*(n - 1)!/(n - j)!, {j, 1, n}]];
    a[n_] := b[n, 0];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Dec 13 2023, after Alois P. Heinz *)

Formula

a(n) = Sum_{prime p <= n} A346085(n,p).
a(p) = (p-1)! for prime p.
Showing 1-2 of 2 results.