OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
MATHEMATICA
Table[If[Length@ # == 0, 1, First@ #] &@ Select[FactorInteger[n][[All, 1]], GCD[#, n/#] == 1 &], {n, 105}] (* Michael De Vlieger, Oct 30 2016 *)
PROG
(Python)
from sympy import factorint, prime, primepi, isprime, primefactors
def a049084(n): return primepi(n)*(1*isprime(n))
def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
def a028234(n):
f = factorint(n)
return 1 if n==1 else n/(min(f)**f[min(f)])
def a067029(n):
f=factorint(n)
return 0 if n==1 else f[min(f)]
def a277697(n): return 0 if n==1 else a055396(n) if a067029(n)==1 else a277697(a028234(n))
def a008578(n): return 1 if n==1 else prime(n - 1)
def a(n): return a008578(1 + a277697(n)) # Indranil Ghosh, May 16 2017
(PARI) a(n) = {my(f = factor(n)); for(i = 1, #f~, if(f[i, 2] == 1, return(f[i, 1]))); 1; } \\ Amiram Eldar, Jul 28 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 28 2016
STATUS
approved