OFFSET
3,5
COMMENTS
The substrings (each equal to the binary representation of a(n)) may overlap in the binary representation of n.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 3..8190
EXAMPLE
21 in binary is 10101. 101 (5 in decimal) occurs twice in 10101: (101)01 and 10(101). Since no larger integer (when represented in binary) occurs more than once within 10101, then a(21) = 5.
MATHEMATICA
Table[With[{d = IntegerDigits[n, 2]}, SelectFirst[Range[n, 0, -1], SequenceCount[d, IntegerDigits[#, 2], Overlaps -> True] >= 2 &]], {n, 3, 104}] (* Michael De Vlieger, Oct 30 2017 *)
CROSSREFS
KEYWORD
AUTHOR
Leroy Quet, Nov 11 2008
EXTENSIONS
Extended by Ray Chandler, Nov 14 2008
STATUS
approved