OFFSET
1,3
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
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.
MAPLE
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
MATHEMATICA
Array[GCD[#, IntegerReverse[#, 2]] &, 94] (* Michael De Vlieger, Feb 24 2019 *)
PROG
(PARI) a(n) = gcd(n, fromdigits(Vecrev(binary(n)), 2)); \\ Michel Marcus, Feb 25 2019
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jun 20 2009
EXTENSIONS
Example corrected by Leroy Quet, Jun 21 2009
a(4) corrected and sequence extended by R. J. Mathar, Jul 04 2009
STATUS
approved