OFFSET
0,3
LINKS
Carl Pomerance, Permutations with arithmetic constraints, arXiv:2206.01699 [math.NT], 2022.
MAPLE
b:= proc(s, m) option remember; `if`(s={}, 1, add(
`if`(ilcm(nops(s), i)>m, 0, b(s minus {i}, m)), i=s))
end:
a:= n-> b({$1..n}, n):
seq(a(n), n=0..20); # Alois P. Heinz, Jun 06 2022
MATHEMATICA
b[s_, m_] := b[s, m] = If[s == {}, 1, Sum[
If[LCM[Length[s], i]>m, 0, b[s~Complement~{i}, m]], {i, s}]];
a[n_] := b[Range[n], n];
Table[Print[n, " ", a[n]]; a[n], {n, 0, 28}] (* Jean-François Alcover, Jun 25 2022, after Alois P. Heinz *)
PROG
(PARI) a(n) = {my(nb=0); for (i=1, n!, my(p=numtoperm(n, i), ok=1); for (k=1, #p, if (lcm(k, p[k]) > n, ok = 0; break); ); if (ok, nb++); ); nb; }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jun 06 2022
EXTENSIONS
a(12)-a(20) from Seiichi Manyama, Jun 06 2022
a(0), a(21)-a(31) from Alois P. Heinz, Jun 06 2022
STATUS
approved