OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
MATHEMATICA
a[n_] := If[n == 1, 1, GCD[n, Times@@(NextPrime[First[#]]^Last[#] &/@FactorInteger[n])]]; Array[a, 100] (* Amiram Eldar, Dec 05 2018~ *)
PROG
(PARI)
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
(Python)
from math import gcd, prod
from sympy import nextprime, factorint
def A322361(n): return gcd(n, prod(nextprime(p)**e for p, e in factorint(n).items())) # Chai Wah Wu, Dec 26 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 05 2018
STATUS
approved