OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
a[1]:= 1: sa[1]:= "1":
m:= 1:
for n from 2 to 1000 do
if n > a[m] and n > m+1 then m:= m+1 fi;
bn:= convert(convert(n, binary), string);
for j from m by -1 to 1 do
if StringTools[Search](sa[j], bn) <> 0 then
a[n]:= a[n-1]+a[j];
sa[n]:= convert(convert(a[n], binary), string);
break
fi
od
od:
seq(a[n], n=1..1000); # Robert Israel, Oct 07 2015
MATHEMATICA
a[1] = 1; a[n_] := a[n] = a[n - 1] + Max@ Select[ Table[ a@i, {i, 0, n - 1}], StringPosition[ ToString@ FromDigits@ IntegerDigits[n, 2], ToString@ FromDigits@ IntegerDigits[ #, 2]] != {} &]; Table[ a@n, {n, 57}] (* Robert G. Wilson v, Aug 17 2009 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 02 2009
EXTENSIONS
a(13) to a(57) from Robert G. Wilson v, Aug 17 2009
STATUS
approved