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!)
A076775 Greatest common divisor of n and the binary representation of n interpreted decimally. 3
1, 2, 1, 4, 1, 2, 1, 8, 1, 10, 1, 4, 1, 2, 1, 16, 1, 2, 1, 20, 21, 2, 1, 8, 1, 2, 1, 4, 1, 10, 1, 32, 11, 2, 1, 4, 1, 2, 1, 40, 1, 42, 1, 4, 1, 2, 1, 16, 1, 10, 1, 4, 1, 2, 1, 8, 1, 2, 1, 20, 1, 2, 21, 64, 1, 22, 1, 4, 3, 10, 1, 8, 1, 2, 1, 4, 1, 2, 1, 80, 3, 2, 1, 84, 1, 2, 1, 8, 1, 10, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
12 is '1100' in binary representation: a(12) = gcd(12,1100) = gcd(3*2^2,11*5^2*2^2) = 4.
MATHEMATICA
Table[GCD[n, FromDigits[IntegerDigits[n, 2]]], {n, 100}] (* Harvey P. Dale, Jun 18 2014 *)
PROG
(PARI)
A007088(n) = fromdigits(binary(n), 10); \\ From A007088.
A076775(n) = gcd(n, A007088(n)); \\ Antti Karttunen, May 18 2019
(Python)
from math import gcd
def A076775(n): return gcd(n, int(bin(n)[2:])) # Chai Wah Wu, Sep 12 2022
CROSSREFS
Cf. A007088.
Sequence in context: A322362 A087258 A333763 * A357689 A324873 A325566
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Nov 14 2002
STATUS
approved

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 September 1 09:54 EDT 2024. Contains 375584 sequences. (Running on oeis4.)