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.
%I A277032 #9 Mar 13 2021 10:04:38 %S A277032 1,1,5,20,109,668,4801,38894,353811,3561512,39374609,474132730, %T A277032 6179650125,86676293916,1301952953989,20852719565694,354771488612075, %U A277032 6389625786835184,121456993304945749,2429966790591643402,51042656559451380013,1123165278137918510772 %N A277032 Number of permutations of [n] such that the minimal cyclic distance between elements of the same cycle equals one, a(1)=1 by convention. %H A277032 Per Alexandersson et al., <a href="https://mathoverflow.net/questions/168885">d-regular partitions and permutations</a>, MathOverflow, 2014 %e A277032 a(2) = 1: (1,2). %e A277032 a(3) = 5: (1,2,3), (1,3,2), (1)(2,3), (1,2)(3), (1,3)(2). %p A277032 b:= proc(n, i, l) option remember; `if`(n=0, mul(j!, j=l), %p A277032 (m-> add(`if`(i=j or n*j=1, 0, b(n-1, j, `if`(j>m, %p A277032 [l[], 0], subsop(j=l[j]+1, l)))), j=1..m+1))(nops(l))) %p A277032 end: %p A277032 a:= n-> `if`(n=1, 1, n!-b(n-1, 1, [0])): %p A277032 seq(a(n), n=1..15); %t A277032 b[n_, i_, l_] := b[n, i, l] = If[n == 0, Product[j!, {j, l}], With[{m = Length[l]}, Sum[If[i == j || n*j == 1, 0, b[n-1, j, If[j>m, Append[l, 0], ReplacePart[l, j -> l[[j]]+1]]]], {j, 1, m+1}]]]; %t A277032 a[n_] := If[n == 1, 1, n! - b[n-1, 1, {0}]]; %t A277032 Array[a, 15] (* _Jean-François Alcover_, Mar 13 2021, after _Alois P. Heinz_ *) %Y A277032 Column k=1 of A277031. %Y A277032 Cf. A002467, A180191, A276975. %K A277032 nonn %O A277032 1,3 %A A277032 _Alois P. Heinz_, Sep 25 2016