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.

A333710 Number of permutations sigma of [n] such that i! divides Product_{k=1..i} sigma(k) for 1 <= i <= n.

Original entry on oeis.org

1, 1, 2, 4, 14, 28, 212, 424, 3060, 13488, 131212, 262424, 6444376, 12888752, 145241952, 2146993212, 40313750564, 80627501128, 2265599072684, 4531198145368, 173216179971224, 3202520631881824, 42018513097187068, 84037026194374136, 7051753589203676704, 50056536119264986708
Offset: 0

Views

Author

Seiichi Manyama, Apr 09 2020

Keywords

Examples

			a(4) = 14: 1234, 1432, 2134, 2314, 2341, 2431, 3214, 3241, 3412, 3421, 4132, 4231, 4312, 4321.
a(5) = 28: 12345, 14325, 21345, 23145, 23415, 23451, 23541, 24315, 24351, 25341, 32145, 32415, 32451, 32541, 34125, 34215, 34251, 34521, 41325, 42315, 42351, 43125, 43215, 43251, 43521, 45321, 52341, 54321.
		

Crossrefs

Programs

  • Maple
    b:= proc(s, p) option remember; (n-> `if`(n=0, 1, add(`if`(
          irem(p*n, j, 'q')=0, b(s minus {j}, q), 0), j=s)))(nops(s))
        end:
    a:= n-> b({$1..n}, 1):
    seq(a(n), n=0..17);  # Alois P. Heinz, Apr 09 2020
  • Mathematica
    b[s_, p_] := b[s, p] = Module[{n=Length[s], q, r}, If[n==0, 1, Sum[If[{q, r} = QuotientRemainder[p n, j]; r==0, b[s~Complement~{j}, q], 0], {j, s}]]];
    a[n_] := a[n] = If[n>2 && PrimeQ[n], 2 a[n-1], b[Range[n], 1]];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 25}] (* Jean-François Alcover, Nov 16 2020, after Alois P. Heinz *)
  • PARI
    {a(n) = if(n==0, 1, my(k=0); forperm([1..n], p, if(#Set(vector(n, i, prod(j=1, i, p[j])%i!))==1, k++)); k)}

Formula

a(p) = 2*a(p-1) if p is prime.

Extensions

a(14)-a(25) from Alois P. Heinz, Apr 09 2020