OFFSET
1,2
COMMENTS
a(n) = a prime for every n >= 2.
EXAMPLE
The divisors of 28 are 1,2,4,7,14,28. Since 4 is not coprime with 2, but 2 is coprime with 1, then a(28) = 2.
MAPLE
with(numtheory): a:= proc(n) local l, j, s, h, k; l:= sort([divisors(n)[]]); s:= nops(l); for k while k<=s do h:= k; for j from k+1 to s do if igcd(l[k], l[j])=1 then h:=j else break fi od; s:= h od; l[s] end: seq(a(n), n=1..100); # Alois P. Heinz, Aug 04 2009
MATHEMATICA
a[n_] := Module[{l = Divisors[n], j, s, h, k}, s = Length[l]; For[k = 1, k <= s, k++, h = k; For[j = k + 1, j <= s, j++, If[GCD[l[[k]], l[[j]]] == 1, h = j, Break[]]]; s = h]; l[[s]]];
Array[a, 100] (* Jean-François Alcover, Nov 20 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 01 2009, Jul 23 2009
EXTENSIONS
More terms from Alois P. Heinz, Aug 04 2009
STATUS
approved