A277427 Prime permutations, ordered lexicographically.
1, 2, 1, 3, 1, 2, 3, 2, 1, 4, 1, 2, 3, 4, 1, 3, 2, 4, 2, 1, 3, 4, 2, 3, 1, 4, 3, 1, 2, 4, 3, 2, 1, 5, 1, 2, 3, 4, 5, 1, 2, 4, 3, 5, 1, 3, 2, 4, 5, 1, 3, 4, 2, 5, 1, 4, 2, 3, 5, 1, 4, 3, 2, 5, 2, 1, 3, 4, 5, 2, 1, 4, 3, 5, 2, 3, 1, 4, 5, 2, 3, 4, 1, 5, 2, 4, 1, 3, 5, 2, 4, 3, 1, 5, 3, 1, 2, 4, 5, 3, 1, 4, 2, 5, 3, 2, 1
Offset: 1
Examples
The sequence of prime permutations begins: 1, 21, 312, 321, 4123, 4132, 4213, 4231, 4312, 4321, ...
Links
- Gus Wiseman, Table of n, a(n) for n = 1..5912
Programs
-
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 *)
Comments