OFFSET
1,4
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local F, t;
F:= ifactors(n)[2];
if nops(F) = 1 then n/F[1, 1]
else max(map(t -> t[1]^t[2], F))
fi
end proc:
f(1):= 1:
map(f, [$1..100]); # Robert Israel, Nov 19 2023
MATHEMATICA
Join[{1}, Table[Last[Select[Divisors[n], # < n && (# == 1 || PrimePowerQ[#]) &]], {n, 2, 85}]]
a[n_] := Module[{f = FactorInteger[n]}, If[Length[f] == 1, f[[1, 1]]^(f[[1, 2]] - 1), Max[Power @@@ f]]]; Array[a, 100] (* Amiram Eldar, Oct 19 2023 *)
PROG
(PARI) a(n) = if (n==1, 1, my(d=divisors(n)); vecmax(select(x->(isprimepower(x) || (x==1)), Vec(d, #d-1)))); \\ Michel Marcus, Oct 17 2023
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Oct 17 2023
STATUS
approved