login
A152221
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
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, 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, 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
OFFSET
1,6
COMMENTS
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.
EXAMPLE
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.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Nov 29 2008
EXTENSIONS
Extended by Ray Chandler, Dec 05 2008
STATUS
approved