A229120 Inverse of permutation A229119.
1, 3, 2, 7, 6, 5, 15, 14, 4, 13, 10, 31, 30, 12, 29, 9, 26, 21, 63, 62, 28, 61, 8, 25, 58, 11, 18, 53, 42, 127, 126, 60, 125, 24, 57, 122, 17, 27, 50, 117, 22, 37, 106, 85, 255, 254, 124, 253, 56, 121, 250, 16, 49, 59, 114, 245, 19, 34, 54, 101, 234, 20, 45, 74, 213, 170, 511, 510, 252, 509, 120, 249, 506, 48
Offset: 1
Keywords
Examples
See A229119.
Crossrefs
Cf. A226062.
Programs
-
Mathematica
<< Combinatorica`; unrankpartition[n_Integer, k_Integer] := Block[{ove, res, qq, zz, mem}, ove=PartitionsP[n]-k; res={}; While[n-Tr[res]>0, qq=0; zz=0; While[(mem=NumberOfPartitions[n-Tr[res], qq + 1]) <= ove, zz = mem; qq++]; AppendTo[res, qq + 1]; ove = ove-zz]; res] /; k <= PartitionsP[n] && k > 0; unrankpartition[n_Integer,All]:=Block[{k=1,z},While[( z=Tr[PartitionsP[Range@k]])
Comments