OFFSET
2,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..5000
EXAMPLE
The divisors of 30 are 1,2,3,5,6,10,15,30. 5 is coprime to 6, so a(30) >= 6. Checking the greatest common divisors of all pairs of distinct divisors >= 6: GCD(6,30)=6, GCD(6,15)=3, GCD(6,10)=2, GCD(10,30)=10, GCD(10,15)=5, and GCD(15,30) = 15. Since all of these GCD's are >= 2, then a(30) = 6.
MAPLE
with(numtheory): a:= proc(n) local l, j, m, s, h, k; l:= sort([divisors(n) []]); m:= nops(l); h:= m; s:= 1; k:= m; do for j from k to s by -1 do if igcd (l[k], l[j])>1 then h:=j else break fi od; s:= h; k:= k-1; if k<s then break fi od; l[s] end: seq (a(n), n=2..100); # Alois P. Heinz, Aug 03 2009
MATHEMATICA
a[n_] := Module[{dd = Divisors[n], selQ}, selQ[d_] := Module[{sd = Select[ dd, # >= d&]}, FreeQ[GCD@@@Subsets[sd, {2}], 1]]; SelectFirst[dd, selQ]];
a /@ Range[2, 100] (* Jean-François Alcover, Nov 20 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 28 2009
EXTENSIONS
More terms from Alois P. Heinz, Aug 03 2009
STATUS
approved