A246143 Index sequence for limit-block extending A004539 (base-2 representation of sqrt(2)) with first term as initial block.
1, 3, 17, 18, 35, 45, 239, 341, 470, 1180, 1230, 2205, 5318, 45652, 68042, 73350, 119458, 388804, 475300, 773496, 836779, 845397, 1133816, 2670010
Offset: 1
Examples
S = A004539, with B = (s(1)); that is, (m,k) = (1,0) S = (1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, ...) B'(0) = (1) B'(1) = (1,1) B'(2) = (1,1,1) B'(3) = (1,1,1,0) B'(4) = (1,1,1,0,0) B'(5) = (1,1,1,0,0,1) S^ = (1,1,1,0,0,1,1,0,1,0,0,1,1,0,...), with index sequence (1,3,17,18,35,45,239,341,...)
Programs
-
Mathematica
seqPosition1[list_, seqtofind_] := If[Length[#] > Length[list], {}, Last[Last[Position[Partition[list, Length[#], 1], Flatten[{_, #, _}], 1, 1]]]] &[seqtofind]; s = RealDigits[Sqrt[2], 2, 10000000][[1]]; Take[s, 60] t = {{1}}; p[0] = seqPosition1[s, Last[t]]; s = Drop[s, p[0]]; Off[Last::nolast]; n = 1; While[(p[n] = seqPosition1[s, Last[t]]) > 0, (AppendTo[t, Take[s, {#, # + Length[Last[t]]}]]; s = Drop[s, #]) &[p[n]]; n++]; On[Last::nolast]; Last[t] (*A246142*) Accumulate[Table[p[k], {k, 0, n - 1}]] (*A246143*)
Comments