A229119 a(n) is the (reversed lexicographic, alias Mathematica ordering) rank of the partition associated with integer n by encoding the run lengths of the binary representation of n.
1, 3, 2, 9, 6, 5, 4, 23, 16, 11, 26, 14, 10, 8, 7, 52, 37, 27, 57, 62, 18, 41, 85, 34, 24, 17, 38, 21, 15, 13, 12, 109, 79, 58, 116, 126, 42, 86, 168, 253, 92, 29, 133, 179, 63, 125, 238, 74, 53, 39, 80, 88, 28, 59, 118, 49, 35, 25, 54, 32, 22, 20, 19, 214, 158, 117, 225, 240, 87, 169, 316, 463, 181, 64, 256, 335, 127, 239, 438, 851, 352, 134, 484, 265, 44, 189, 657, 630, 254, 93, 353, 461, 180, 334, 600, 151, 110, 81, 159, 172, 60
Offset: 1
Keywords
Examples
The partition associated with 24 is found as follows (see A226062): Write 24 in binary as 11000; the run lengths are 2,3. Now subtract 1 from all but the last integer, giving 1,3. Now reverse to 3,1; take running sum giving 3,4 and reverse again to partition {4,3}; Finally, note that {4,3} is the 5th partition of 7, and the 34th partition overall. This shows that a(24)=34.
Crossrefs
Cf. A226062.
Programs
-
Mathematica
<< Combinatorica`; rankpartition[(p_)?PartitionQ] := PartitionsP[Tr[p]] -Sum[(NumberOfPartitions[Tr[#1], First[#1]-1]& )[Drop[p,k]], {k,0,Length[p]-1}]; rankpartition[par_?PartitionQ,All]:=Tr[PartitionsP[Range[Tr[par]-1]]]+rankpartition[par]; int2par[n_Integer]:=Block[{t0,t1,t2},t0=Length/@Split[IntegerDigits[n,2]];t1=Reverse@MapAt[#+1&,-1+t0,-1];t2=FoldList[Plus,First[t1], Rest[t1]];Reverse[t2]]; a=Table[ rankpartition[#,All]& @ int2par[n],{n,138}]
Comments