login
Smallest k > 0 with gcd(k, rev(k)) = n, where rev(k) is digit reversal of k, or 0 if no such k exists.
12

%I #15 Oct 16 2019 01:30:57

%S 1,2,3,4,5,6,7,8,9,0,11,48,1495,2072,510,2192,1156,234,2489,0,168,22,

%T 3358,840,5200,2678,2889,4256,5017,0,1178,21920,33,20774,5075,216,

%U 1009009009009,2318,1677,0,1066,2436,15523,44,540,20516,30644,8400,18718,0,1479,21788

%N Smallest k > 0 with gcd(k, rev(k)) = n, where rev(k) is digit reversal of k, or 0 if no such k exists.

%e a(12) = 48 as gcd(48,84) = 12.

%o (PARI) a(n) = {if (n % 10 == 0, return (0)); k = 1; while (gcd(k, subst(Polrev(digits(k)), x, 10)) != n, k++); k;} \\ _Michel Marcus_, Sep 14 2013

%K nonn,base

%O 1,2

%A _Amarnath Murthy_, Mar 22 2002

%E Edited by _David W. Wilson_ and _Don Reble_, Jun 04 2002