OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
MAPLE
a:= proc(n) local p, s; s:= numtheory[factorset](n);
if s={} then return 1
else p:= max(s);
do if p=2 then return 1 else p:= prevprime(p) fi;
if not p in s then return p fi
od
fi
end:
seq(a(n), n=1..100); # Alois P. Heinz, Sep 03 2019
MATHEMATICA
a[n_] := Module[{p}, For[p = NextPrime[FactorInteger[n][[-1, 1]], -1], p>1, p = NextPrime[p, -1], If[!Divisible[n, p], Return[p]]]; 1];
Array[a, 100] (* Jean-François Alcover, Nov 04 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Dec 20 2002
STATUS
approved