This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A165818 Largest integer coprime to n whose binary representation is a substring of the binary representation of n. 0
 1, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 3, 7, 1, 8, 1, 9, 1, 10, 5, 11, 1, 12, 5, 13, 3, 14, 7, 15, 1, 16, 1, 17, 1, 18, 9, 19, 1, 20, 5, 21, 5, 22, 11, 23, 1, 24, 9, 25, 5, 26, 13, 27, 3, 28, 13, 29, 7, 30, 15, 31, 1, 32, 1, 33, 1, 34, 17, 35, 1, 36, 9, 37, 9, 38, 19, 39, 1, 40, 9, 41, 5, 42, 21 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,5 LINKS EXAMPLE 14 in binary is 1110. The integers that, when written in binary, occur as substrings in 1110 are 0, 1, 2 (10 in binary), 3 (11 in binary), 6 (110 in binary), 7 (111 in binary), and 14 (1110 in binary). Of these, 3 is the largest that is coprime to 14. So a(14) = 3. PROG (PARI) { a(n) = my(m, b, s); m=0; b=binary(n); for(i=1, #b, for(j=i, #b, s=sum(k=i, j, b[k]*2^(j-k)); if(gcd(s, n)==1&&m

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 17 16:56 EDT 2019. Contains 324196 sequences. (Running on oeis4.)