A297932 Rectangular array, by antidiagonals: row n gives the numbers whose base-2 digits d(m), d(m-1),...,d(0) having n as maximal run-length of 0's.
1, 3, 2, 7, 5, 4, 15, 6, 9, 8, 31, 10, 12, 17, 16, 63, 11, 18, 24, 33, 32, 127, 13, 19, 34, 48, 65, 64, 255, 14, 20, 35, 66, 96, 129, 128, 511, 21, 25, 40, 67, 130, 192, 257, 256, 1023, 22, 28, 49, 80, 131, 258, 384, 513, 512, 2047, 23, 36, 56, 97, 160, 259
Offset: 1
Examples
Northwest corner: 1 3 7 15 31 63 127 2 5 6 10 11 13 14 4 9 12 18 19 20 25 8 17 24 34 35 40 49 16 33 48 66 67 80 97 32 65 96 130 131 160 193 *** Base-2 digits of 72: 1,0,0,1,0,0,0 with runs 00 and 000 of 0's, so that 72 is in row 3.
Programs
-
Mathematica
b = 2; s[n_] := Split[IntegerDigits[n, b]]; m[n_, d_] := Union[Select[s[n], MemberQ[#, d] &]] h[n_, d_] := Max[Map[Length, m[n, d]]] z = 6000; w = t[d_] := Table[h[n, d], {n, 1, z}] /. -Infinity -> 0 TableForm[Table[Flatten[Position[t[0], d]], {d, 0, 8}]] (* A297932 array *) u[d_] := Flatten[Position[t[0], d]] v[d_, n_] := u[d][[n]]; Table[v[n, k - n + 1], {k, 0, 11}, {n, 0, k}] // Flatten (* A297932 sequence *)
Comments