login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

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 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A162404 a(1)=1. a(n) = a(n-1) + (the largest value among (a(1),a(2),...,a(n-1)) that when written in binary occurs as a substring in the binary representation of n). 3
1, 2, 3, 5, 10, 13, 16, 18, 20, 30, 35, 38, 51, 54, 57, 73, 75, 93, 96, 116, 126, 131, 136, 139, 142, 155, 168, 171, 184, 214, 217, 233, 249, 251, 286, 304, 322, 360, 363, 383, 403, 413, 423, 428, 441, 446, 451, 467, 470, 488, 539, 559, 572, 626, 639, 642, 699 (list; graph; refs; listen; history; text; internal format)
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

Cf. A162405, A162406.

Sequence in context: A289536 A022426 A005677 * A084760 A186082 A103746

Adjacent sequences: A162401 A162402 A162403 * A162405 A162406 A162407

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 6 19:33 EST 2022. Contains 358648 sequences. (Running on oeis4.)