OFFSET
2,1
LINKS
EXAMPLE
Triangle starts with n=2:
2;
2, 6;
2, 12, 24;
2, 20, 72, 120;
2, 34, 180, 480, 720;
PROG
(Haskell) a n x = filter (\l -> all (< x) (zipWith (\x y -> abs (x - y)) l (tail l))) (permutations [1 .. n])
(PARI) isokp(perm, k) = {for (i=1, #perm-1, if (abs(perm[i]-perm[i+1]) >= k, return (0)); ); return (1); }
tabl(nn) = {for (n=2, nn, for (k=2, n, print1(sum(i=1, n!, isokp(numtoperm(n, i), k)), ", "); ); print(); ); } \\ Michel Marcus, Nov 06 2014
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Li-yao Xia, Nov 02 2014
STATUS
approved