OFFSET
1,2
COMMENTS
EXAMPLE
A004713 gives the positions of 1 in the base 2 expansion of 1/sqrt(2), which begins thus: 1,0,1,1,0,1,0,1,0,0,0,0,0,1,0,0,1,1,1,1. The block consisting of the first 1 terms is 1, and it occurs at positions 1,3,4,6,8,14,..., so that this is row 1 of A246340. The block consisting of the first 5 terms is 1,0,1,1,0, and it begins at the positions shown in row 5.
The first 6 rows follow:
1 .. 3 ... 4 ... 6 ... 8 ... 14 ...
1 .. 4 ... 6 ... 8 ... 14 .. 20 ...
1 .. 4 ... 6 ... 42 .. 66 .. 72 ...
1 .. 42 .. 66 .. 72 .. 78 .. 89 ...
1 .. 66 . 78 .. 89 .. 136 . 144 ..
1 .. 136 . 195 . 370 . 437 . 504 ..
MATHEMATICA
z = 150000; s = RealDigits[1/Sqrt[2], 2, z][[1]]; Flatten[Position[s, 1]];
b[m_, n_] := b[m, n] = Take[s, {m, n}]; z1 = 100000; z2 = 12; t[k_] :=
t[k] = Take[Select[Range[1, z1], b[#, # + k] == b[1, 1 + k] &], z2]
Column[Table[t[k], {k, 0, z2}]](* A246340, array *)
w[n_, k_] := t[n][[k + 1]]; tt = Table[w[n - k, k], {n, 0, z2 - 1}, {k, n, 0, -1}] // Flatten (* A246340, sequence *)
CROSSREFS
KEYWORD
AUTHOR
Clark Kimberling, Aug 24 2014
STATUS
approved