login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A333710
Number of permutations sigma of [n] such that i! divides Product_{k=1..i} sigma(k) for 1 <= i <= n.
3
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,3
FORMULA
a(p) = 2*a(p-1) if p is prime.
EXAMPLE
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.
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 *)
PROG
(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)}
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Apr 09 2020
EXTENSIONS
a(14)-a(25) from Alois P. Heinz, Apr 09 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 16:18 EDT 2024. Contains 376119 sequences. (Running on oeis4.)