login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
3
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,2
COMMENTS
Every positive integer occurs exactly once, so that as a sequence, this is a permutation of the positive integers.
EXAMPLE
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.
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 *)
CROSSREFS
Sequence in context: A278503 A283940 A163255 * A066884 A171429 A191448
KEYWORD
nonn,base,easy,tabl
AUTHOR
Clark Kimberling, Jan 26 2018
STATUS
approved