login
a(n) = gcd(n,c(n)), where c(n) is the 10's complement of n.
4

%I #16 Nov 05 2018 14:10:50

%S 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,

%T 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,

%U 2,1,4,1,10,1,4,1,2,25,4,1,2,1,20,1,2

%N a(n) = gcd(n,c(n)), where c(n) is the 10's complement of n.

%H Alois P. Heinz, <a href="/A068822/b068822.txt">Table of n, a(n) for n = 1..9999</a>

%F a(n) = gcd(n,A089186(n)) = gcd(n,A178914(n)). - _Alois P. Heinz_, Nov 05 2018

%e a(45) = 5 as 10's complement of 45 is 100-45 = 55 and (45,55) = 5.

%p a:=n-> igcd((10^length(n)-n), n):

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Sep 22 2015

%t GCD[#, 10^(IntegerLength[#]) - #] & /@ Range[82] (* _Jayanta Basu_, Aug 07 2013 *)

%Y Cf. A089186, A178914.

%K nonn,base,easy

%O 1,2

%A _Amarnath Murthy_, Mar 08 2002