A125106 Enumeration of partitions by binary representation: each 1 is a part; the part size is 1 more than the number of 0's in the rest of the number.
1, 2, 1, 1, 3, 2, 1, 2, 2, 1, 1, 1, 4, 3, 1, 3, 2, 2, 1, 1, 3, 3, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 5, 4, 1, 4, 2, 3, 1, 1, 4, 3, 3, 2, 1, 3, 2, 2, 2, 1, 1, 1, 4, 4, 3, 3, 1, 3, 3, 2, 2, 2, 1, 1, 3, 3, 3, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1
Offset: 1
Examples
Row 4: 1000 [4] 1001 [3,1] 1010 [3,2] 1011 [2,1,1] 1100 [3,3] 1101 [2,2,1] 1110 [2,2,2] 1111 [1,1,1,1]
Links
- Alois P. Heinz, Rows n = 1..12, flattened
Crossrefs
Programs
-
Maple
b:= proc(n) local c, l, m; l:=[][]; m:= n; c:=1; while m>0 do if irem(m, 2, 'm')=0 then c:= c+1 else l:= c, l fi od; l end: T:= n-> seq(b(i), i=2^(n-1)..2^n-1): seq(T(n), n=1..7); # Alois P. Heinz, Sep 25 2015
-
Mathematica
f[k_] := (bits = IntegerDigits[k, 2]; zerosCount = Reverse[ Accumulate[ 1-Reverse[bits] ] ] + 1; Select[ Transpose[ {bits, zerosCount} ], First[#] == 1 & ][[All, 2]]); row[n_] := Table[ f[k], {k, 2^(n-1), 2^n-1}]; Flatten[ Table[ row[n], {n, 1, 5}]] (* Jean-François Alcover, Jan 24 2012 *) scc[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; Table[Reverse[scc[n]-Range[Length[scc[n]]]+1],{n,0,20}] (* Gus Wiseman, Jan 17 2023 *)
Formula
Partition 2n is partition n with every part size increased by 1; partition 2n+1 is partition n with an additional part of size 1.
Extensions
Edited by Franklin T. Adams-Watters, Jun 11 2009
Comments