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!)
A161825 a(n) is the GCD of n and {the number made by reversing the order of the digits of n written in binary}. 2

%I #15 Feb 25 2019 16:46:31

%S 1,1,3,1,5,3,7,1,9,5,1,3,1,7,15,1,17,9,1,5,21,1,1,3,1,1,27,7,1,15,31,

%T 1,33,17,7,9,1,1,3,5,1,21,1,1,45,1,1,3,7,1,51,1,1,27,1,7,3,1,1,15,1,

%U 31,63,1,65,33,1,17,3,7,1,9,73,1,15,1,1,3,1,5,3,1,1,21,85,1,3,1,1,45,1,1,93,1

%N a(n) is the GCD of n and {the number made by reversing the order of the digits of n written in binary}.

%H Michael De Vlieger, <a href="/A161825/b161825.txt">Table of n, a(n) for n = 1..10000</a>

%e 70 in binary is 1000110. Reversing this (and ignoring the leading 0), we have 110001, which is 49 in decimal. Therefore a(70) = gcd(70,49) = 7.

%p A030101 := proc(n) local bdgs; bdgs := convert(n,base,2) ; add( op(-i,bdgs)*2^(i-1), i=1..nops(bdgs)) ; end: A161825 := proc(n) gcd(A030101(n),n) ; end: seq(A161825(n),n=1..100) ; # _R. J. Mathar_, Jul 04 2009

%t Array[GCD[#, IntegerReverse[#, 2]] &, 94] (* _Michael De Vlieger_, Feb 24 2019 *)

%o (PARI) a(n) = gcd(n, fromdigits(Vecrev(binary(n)), 2)); \\ _Michel Marcus_, Feb 25 2019

%Y Cf. A030101.

%K base,nonn

%O 1,3

%A _Leroy Quet_, Jun 20 2009

%E Example corrected by _Leroy Quet_, Jun 21 2009

%E a(4) corrected and sequence extended by _R. J. Mathar_, Jul 04 2009

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 18 20:26 EDT 2024. Contains 371781 sequences. (Running on oeis4.)