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.

A354756 a(n) is the number of permutations p of [n] such that lcm(i, p(i)) <= n for all i in [n].

Original entry on oeis.org

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

Views

Author

Michel Marcus, Jun 06 2022

Keywords

Crossrefs

Cf. A320843.

Programs

  • 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 *)
  • 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;}

Extensions

a(12)-a(20) from Seiichi Manyama, Jun 06 2022
a(0), a(21)-a(31) from Alois P. Heinz, Jun 06 2022