OFFSET
1,2
COMMENTS
Let the binary representation of n be thought of as a string of 0's and 1's. By a "run" of 0's or 1's, it is meant either a contiguous substring all of 0's bounded by 1's or the by the edge of the string, or a contiguous substring all of 1's bounded by 0's or the by the edge of the string.
MATHEMATICA
Select[Range[150], And@@IntegerQ/@(Log[2, # ]&/@Length/@Split[IntegerDigits[ #, 2]])&] (* Ray Chandler, May 19 2009 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, May 17 2009
EXTENSIONS
Extended by Ray Chandler, May 19 2009
STATUS
approved