cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A076775 Greatest common divisor of n and the binary representation of n interpreted decimally.

This page as a plain text file.
%I A076775 #16 Sep 12 2022 11:27:20
%S A076775 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,
%T A076775 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,
%U A076775 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
%N A076775 Greatest common divisor of n and the binary representation of n interpreted decimally.
%H A076775 Antti Karttunen, <a href="/A076775/b076775.txt">Table of n, a(n) for n = 1..16384</a>
%H A076775 Antti Karttunen, <a href="/A076775/a076775.txt">Data supplement: n, a(n) computed for n = 1..65537</a>
%H A076775 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%e A076775 12 is '1100' in binary representation: a(12) = gcd(12,1100) = gcd(3*2^2,11*5^2*2^2) = 4.
%t A076775 Table[GCD[n,FromDigits[IntegerDigits[n,2]]],{n,100}] (* _Harvey P. Dale_, Jun 18 2014 *)
%o A076775 (PARI)
%o A076775 A007088(n) = fromdigits(binary(n), 10); \\ From A007088.
%o A076775 A076775(n) = gcd(n, A007088(n)); \\ _Antti Karttunen_, May 18 2019
%o A076775 (Python)
%o A076775 from math import gcd
%o A076775 def A076775(n): return gcd(n,int(bin(n)[2:])) # _Chai Wah Wu_, Sep 12 2022
%Y A076775 Cf. A007088.
%K A076775 nonn,base
%O A076775 1,2
%A A076775 _Reinhard Zumkeller_, Nov 14 2002