A068822 a(n) = gcd(n,c(n)), where c(n) is the 10's complement of n.
1, 2, 1, 2, 5, 2, 1, 2, 1, 10, 1, 4, 1, 2, 5, 4, 1, 2, 1, 20, 1, 2, 1, 4, 25, 2, 1, 4, 1, 10, 1, 4, 1, 2, 5, 4, 1, 2, 1, 20, 1, 2, 1, 4, 5, 2, 1, 4, 1, 50, 1, 4, 1, 2, 5, 4, 1, 2, 1, 20, 1, 2, 1, 4, 5, 2, 1, 4, 1, 10, 1, 4, 1, 2, 25, 4, 1, 2, 1, 20, 1, 2
Offset: 1
Examples
a(45) = 5 as 10's complement of 45 is 100-45 = 55 and (45,55) = 5.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..9999
Programs
-
Maple
a:=n-> igcd((10^length(n)-n), n): seq(a(n), n=1..100); # Alois P. Heinz, Sep 22 2015
-
Mathematica
GCD[#, 10^(IntegerLength[#]) - #] & /@ Range[82] (* Jayanta Basu, Aug 07 2013 *)