OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^14, with a color function showing prime n in red, n that is a proper prime power in gold, n that is composite and squarefree in green, and n that is neither squarefree nor prime power in blue and magenta, where magenta signifies powerful n that is not a prime power.
MATHEMATICA
a[n_] := If[PrimePowerQ[n], n, SelectFirst[Transpose@ {Reverse@ #[[-Ceiling[Length[#]/2] ;; -2]], #[[2 ;; Ceiling[Length[#]/2]]]} &@ Divisors[n], CoprimeQ @@ # &][[1]] ]; a[1] = 1; Array[a, 120] (* Michael De Vlieger, Jun 24 2025 *)
PROG
(PARI) A324388(n) = if(1>=omega(n), n, fordiv(n, d, if((d>1)&&(1==gcd(d, n/d)), return(n/d))));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen and David James Sycamore, Feb 28 2019
STATUS
approved
