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.

A060014 Sum of orders of all permutations of n letters.

Original entry on oeis.org

1, 1, 3, 13, 67, 471, 3271, 31333, 299223, 3291487, 39020911, 543960561, 7466726983, 118551513523, 1917378505407, 32405299019941, 608246253790591, 12219834139189263, 253767339725277823, 5591088918313739017, 126036990829657056711, 2956563745611392385211
Offset: 0

Views

Author

N. J. A. Sloane, Mar 17 2001

Keywords

Comments

Conjecture: This sequence eventually becomes cyclic mod n for all n. - Isaac Saffold, Dec 01 2019

Examples

			For n = 4 there is 1 permutation of order 1, 9 permutations of order 2, 8 of order 3 and 6 of order 4, for a total of 67.
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section XIII.2, p. 460.

Crossrefs

Programs

  • Maple
    b:= proc(n, g) option remember; `if`(n=0, g, add((j-1)!
          *b(n-j, ilcm(g, j))*binomial(n-1, j-1), j=1..n))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 11 2017
  • Mathematica
    CoefficientList[Series[Sum[n Fold[#1+MoebiusMu[n/#2] Apply[Times, Exp[x^#/#]&/@Divisors[#2] ]&,0,Divisors[n]],{n,Max[Apply[LCM,Partitions[19],1]]}],{x,0,19}],x] Range[0,19]! (* Wouter Meeussen, Jun 16 2012 *)
    a[ n_] := If[ n < 1, Boole[n == 0], 1 + Total @ Apply[LCM, Map[Length, First /@ PermutationCycles /@ Drop[Permutations @ Range @ n, 1], {2}], 1]]; (* Michael Somos, Aug 19 2018 *)
  • PARI
    \\ Naive method -- sum over cycles directly
    cycleDecomposition(v:vec)={
        my(cyc=List(), flag=#v+1, n);
        while((n=vecmin(v))<#v,
            my(cur=List(), i, tmp);
            while(v[i++]!=n,);
            while(v[i] != flag,
                listput(cur, tmp=v[i]);
                v[i]=flag;
                i=tmp
            );
            if(#cur>1, listput(cyc, Vec(cur)))    \\ Omit length-1 cycles
        );
        Vec(cyc)
    };
    permutationOrder(v:vec)={
        lcm(apply(length, cycleDecomposition(v)))
    };
    a(n)=sum(i=0,n!-1,permutationOrder(numtoperm(n,i)))
    \\ Charles R Greathouse IV, Nov 06 2014
    
  • PARI
    A060014(n) =
    {
      my(factn = n!, part, nb, i, j, res = 0);
      forpart(part = n,
        nb = 1; j = 1;
        for(i = 1, #part,
          if (i == #part || part[i + 1] != part[i],
            nb *= (i + 1 - j)! * part[i]^(i + 1 - j);
            j = i + 1));
        res += (factn / nb) * lcm(Vec(part)));
      res;
    } \\ Jerome Raulin, Jul 11 2017 (much faster, O(A000041(n)) vs O(n!))

Formula

E.g.f.: Sum_{n>0} (n*Sum_{i|n} (moebius(n/i)*Product_{j|i} exp(x^j/j))). - Vladeta Jovovic, Dec 29 2004; The sum over n should run to at least A000793(k) for producing the k-th entry. - Wouter Meeussen, Jun 16 2012
a(n) = Sum_{k>=1} k* A057731(n,k). - R. J. Mathar, Aug 31 2017

Extensions

More terms from Vladeta Jovovic, Mar 18 2001
More terms from Alois P. Heinz, Feb 14 2013

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

A382781 Sum of GCD of cycle lengths over all permutations of [n] with distinct cycle lengths.

Original entry on oeis.org

0, 1, 2, 9, 32, 170, 1164, 7434, 62880, 582336, 5875200, 60041520, 841501440, 9440926560, 141618778560, 2222190784800, 34862691548160, 543348318159360, 11173101312844800, 186494289764106240, 4219768887634944000, 86094733814301542400, 1834643656963469721600
Offset: 0

Views

Author

Alois P. Heinz, May 11 2025

Keywords

Examples

			a(3) = 9 = 3+3+1+1+1: (123), (132), (1)(23), (13)(2), (12)(3).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, m) option remember; `if`(i*(i+1)/2 b(n$2, 0):
    seq(a(n), n=0..22);
Showing 1-3 of 3 results.