OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
6 has 4 positive divisors. The divisors of 6 are 1,2,3,6. The divisors of 6 that are coprime to 4 are 1 and 3. 3 is the largest of these; so a(6) = 3.
MAPLE
f := proc (n) local D, t; D := numtheory:-divisors(n); t := nops(D); max(select(proc (d) options operator, arrow; igcd(d, t) = 1 end proc, D)) end proc:
map(f, [$1..100]); # Robert Israel, Feb 11 2018
MATHEMATICA
Table[Select[Divisors[n], GCD[ #, Length[Divisors[n]]] == 1 &][[ -1]], {n, 1, 80}] (* Stefan Steinerberger, Mar 09 2008 *)
PROG
(PARI) a(n) = {my(d = divisors(n)); vecmax(select(x->(gcd(x, #d) == 1), d)); } \\ Michel Marcus, Feb 12 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 23 2008
EXTENSIONS
More terms from Stefan Steinerberger, Mar 09 2008
STATUS
approved