A178475 Permutations of 12345: Numbers having each of the decimal digits 1,...,5 exactly once, and no other digit.
12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13452, 13524, 13542, 14235, 14253, 14325, 14352, 14523, 14532, 15234, 15243, 15324, 15342, 15423, 15432, 21345, 21354, 21435, 21453, 21534, 21543, 23145, 23154, 23415
Offset: 1
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..120 (full sequence)
Programs
-
Mathematica
FromDigits/@Permutations[Range[5]] (* Harvey P. Dale, Jan 19 2019 *)
-
PARI
A178475(n)={my(b=vector(4,k,1+(n-1)%(k+1)!\k!),t=b[4],d=vector(4,i,i+(i>=t)));for(i=1,3,t=10*t+d[b[4-i]];d=vecextract(d,Str("^"b[4-i])));t*10+d[1]} \\ - M. F. Hasler (following N. Johnston's comment), Jan 10 2012
-
PARI
v=vector(5,i,10^(i-1))~; A178475=vecsort(vector(5!,i,numtoperm(5,i)*v)) is_A178475(x)={ vecsort(Vecsmall(Str(x)))==Vecsmall("12345") } forstep( m=12345,54321,9, is_A178475(m) & print1(m","))
Comments