%I #24 Jun 13 2022 08:43:11
%S 1,1,2,3,2,1,2,1,1,1,2,1,2,1,4,5,2,1,2,3,4,1,2,1,3,1,4,3,2,1,2,3,4,1,
%T 4,1,2,1,4,1,2,1,2,3,2,1,2,5,3,3,4,3,2,1,4,1,4,1,2,1,2,1,2,7,4,1,2,3,
%U 4,1,2,1,2,1,2,3,4,1,2,1
%N a(n) = the largest divisor of A000005(n) that is coprime to n. (A000005(n) = the number of positive divisors of n.).
%C Apparently also the denominator of A007955(n)/A000005(n). See A291186. - _Jaroslav Krizek_, Sep 05 2017
%H Michael De Vlieger, <a href="/A137927/b137927.txt">Table of n, a(n) for n = 1..10000</a>
%e 20 has 6 positive divisors. The divisors of 6 are 1,2,3,6. The divisors of 6 that are coprime to 20 are 1 and 3. 3 is the largest of these; so a(20) = 3.
%p A137927 := proc(n)
%p local a;
%p a := 1 ;
%p for d in numtheory[divisors](numtheory[tau](n)) do
%p if igcd(d,n) = 1 then
%p a := max(a,d) ;
%p end if:
%p end do:
%p a ;
%p end proc:
%p seq(A137927(n),n=1..100) ; # _R. J. Mathar_, Sep 22 2017
%t Table[Select[Divisors[Length[Divisors[n]]], GCD[ #, n] == 1 &][[ -1]], {n, 1, 80}] (* _Stefan Steinerberger_, Mar 09 2008 *)
%o (PARI) a(n) = my(d=divisors(numdiv(n))); forstep(k=#d, 1, -1, if (gcd(d[k], n) == 1, return (d[k]))); \\ _Michel Marcus_, Sep 22 2017; corrected Jun 13 2022
%Y Cf. A137926, A007955, A120736, A291899.
%K nonn
%O 1,3
%A _Leroy Quet_, Feb 23 2008
%E More terms from _Stefan Steinerberger_, Mar 09 2008