OFFSET
1,3
COMMENTS
First occurrence of k: 1, 3, 4, 7, 6, 14, 12, 11, 21, 20, 22, 28, 26, 50, 23, 39, 29, 44, 52, 57, 46, 47, 77, 55, 59, ...
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
Binary a(1) = 1, binary a(2) = 1, binary a(3) = 10, binary a(7) = 100 and binary a(8) = 100 are all substrings of binary 9 = 1001. So a(9) = 5.
MAPLE
A[1]:= 1:
S[1]:= "1":
for n from 2 to 100 do
B:= convert(convert(n, binary), string);
A[n]:= nops(select(t -> SearchText(S[t], B)>0, [$1..n-1]));
S[n]:= convert(convert(A[n], binary), string);
od:
seq(A[i], i=1..100); # Robert Israel, Apr 11 2019
MATHEMATICA
f[ s_ ] := Append[ s, Length@ Select[ s, StringPosition[ ToString@ FromDigits@ IntegerDigits[ Length@s + 1, 2 ], ToString@ FromDigits@ IntegerDigits[ #, 2 ] ] != {} & ] ]; Nest[ f, {1}, 79 ] (* Robert G. Wilson v, Nov 01 2006 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Leroy Quet, Oct 25 2006
EXTENSIONS
More terms from Robert G. Wilson v, Nov 01 2006
STATUS
approved