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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #10 Mar 15 2015 20:54:36

%S 1,2,4,5,9,14,16,17,21,30,35,40,44,49,63,64,80,97,106,115,120,141,146,

%T 151,155,164,169,174,188,202,232,233,249,265,282,317,326,335,344,353,

%U 393,402,423,444,488,493,507,512,528,577,586,595,600,621,626,631,645

%N 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).

%H Robert G. Wilson v, <a href="/A162406/b162406.txt">Table of n, a(n) for n = 0..1000</a>. [From _Robert G. Wilson v_, Aug 01 2009]

%t 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 *)

%Y Cf. A162404, A162407.

%K base,nonn

%O 0,2

%A _Leroy Quet_, Jul 02 2009

%E More terms beginning with a(12) from _Robert G. Wilson v_, Aug 01 2009

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 April 19 16:38 EDT 2024. Contains 371794 sequences. (Running on oeis4.)