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”).

A162406
a(0)=1. a(n) = a(n-1) + (the largest value among (a(0),a(1),...a(n-1)) that when written in binary occurs as a substring in the binary representation of n).
3
1, 2, 4, 5, 9, 14, 16, 17, 21, 30, 35, 40, 44, 49, 63, 64, 80, 97, 106, 115, 120, 141, 146, 151, 155, 164, 169, 174, 188, 202, 232, 233, 249, 265, 282, 317, 326, 335, 344, 353, 393, 402, 423, 444, 488, 493, 507, 512, 528, 577, 586, 595, 600, 621, 626, 631, 645
OFFSET
0,2
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..1000. [From Robert G. Wilson v, Aug 01 2009]
MATHEMATICA
a[0] = 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, 0, 53}] (* Robert G. Wilson v, Aug 01 2009 *)
CROSSREFS
Sequence in context: A234588 A118550 A126697 * A129282 A073153 A073154
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 02 2009
EXTENSIONS
More terms beginning with a(12) from Robert G. Wilson v, Aug 01 2009
STATUS
approved