login
a(n) = the largest integer k where the binary representations of both k and of k+1 occur as substrings in the binary representation of n. a(n) = 0 if n = 2^m -1, for m = any positive integer.
1

%I #7 Mar 11 2014 01:32:27

%S 0,1,0,1,1,2,0,1,1,1,2,3,5,6,0,1,1,1,3,4,1,5,2,3,3,5,5,6,13,14,0,1,1,

%T 1,3,1,4,3,3,4,9,1,10,11,5,6,2,3,3,3,3,5,5,5,6,7,6,13,13,14,29,30,0,1,

%U 1,1,3,1,4,3,7,8,1,9,4,3,5,6,3,4,4,9,19,20,1,21,10,11,11,10,5,11,13,14,2,3

%N a(n) = the largest integer k where the binary representations of both k and of k+1 occur as substrings in the binary representation of n. a(n) = 0 if n = 2^m -1, for m = any positive integer.

%C If n = 2^m -1, then there is no pair of consecutive positive integers that, when represented in binary, occur as substrings in the binary representation of n. For n = any positive integer not of the form 2^m -1, there is always at least one positive integer k such that the binary representations of both k and k+1 occur as substrings in the binary representation of n.

%e 12 represented in binary is 1100. a(12) = 3 because the binary representation of 3 (which is 11) occurs in 1100 (like so: (11)00), the binary representation of 4 (which is 100) occurs in 1100 (like so: 1(100)) and no larger pair of consecutive integers occurs within 1100.

%Y A152222

%K base,nonn

%O 1,6

%A _Leroy Quet_, Nov 29 2008

%E Extended by _Ray Chandler_, Dec 05 2008