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!)
A147755 a(n) = the largest integer that, when represented in binary, occurs at least twice as a substring in the binary representation of n. 3

%I #14 Oct 30 2017 20:16:49

%S 1,0,1,1,3,0,1,2,1,1,1,3,7,0,1,2,1,2,5,2,3,1,1,2,3,3,3,7,15,0,1,2,1,4,

%T 2,2,3,2,2,10,5,2,5,3,7,1,1,2,3,2,5,6,3,3,3,3,3,7,7,15,31,0,1,2,1,4,2,

%U 2,3,4,9,2,2,4,2,3,7,2,2,2,2,10,21,5,5,2,2,5,11,3,5,7,15,1,1,2,3,4,2,6,3,2

%N a(n) = the largest integer that, when represented in binary, occurs at least twice as a substring in the binary representation of n.

%C The substrings (each equal to the binary representation of a(n)) may overlap in the binary representation of n.

%H Alois P. Heinz, <a href="/A147755/b147755.txt">Table of n, a(n) for n = 3..8190</a>

%e 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.

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

%Y Cf. A147756, A242869.

%K base,nonn,look

%O 3,5

%A _Leroy Quet_, Nov 11 2008

%E Extended by _Ray Chandler_, Nov 14 2008

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 23 06:04 EDT 2024. Contains 371906 sequences. (Running on oeis4.)