[go: up one dir, main page]

login
A354756
a(n) is the number of permutations p of [n] such that lcm(i, p(i)) <= n for all i in [n].
0
1, 1, 2, 3, 8, 10, 56, 64, 192, 332, 1184, 1264, 12192, 12872, 37568, 100836, 311760, 322320, 2338368, 2408848, 14433408, 32058912, 76931008, 78528704, 919469408, 1158792224, 2689828672, 4675217824, 21679173184, 21984820864, 381078324992, 386159441600
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
Cf. A320843.
Sequence in context: A010786 A248822 A005727 * A361324 A118089 A201541
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