OFFSET
1,2
COMMENTS
A permutation of {1..n} is prime (in the sense of A215474) iff it is of the form (n, q_1, q_2, ..., q_{n-1}).
Row n in the triangle consists of all permutations consisting of n followed by a permutation of 1..n-1, in lexicographic order.
LINKS
Gus Wiseman, Table of n, a(n) for n = 1..5912
EXAMPLE
The sequence of prime permutations begins:
1,
21,
312, 321,
4123, 4132, 4213, 4231, 4312, 4321,
...
MAPLE
seq(op(map(t -> (n, op(t)), combinat:-permute(n-1))), n=1..6); # Robert Israel, Nov 07 2016
MATHEMATICA
row[n_] := Join[{n}, #]& /@ Permutations[Range[n-1]];
Array[row, 5] // Flatten (* Jean-François Alcover, Apr 10 2019 *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Gus Wiseman, Oct 14 2016
STATUS
approved