OFFSET
1,2
COMMENTS
LINKS
Michel Marcus, Table of n, a(n) for n = 1..10000
PROG
(PARI) f(n) = 1 + sum(k=2, n, isprimepower(k) && !isprime(k)); \\ A085501
a(n) = {if (n==1, return (1)); my(p); if (isprimepower(n, &p) && !isprime(n), p, prime(n-f(n))); } \\ Michel Marcus, Jan 28 2021
(Python)
from sympy import primefactors, prime, primepi, integer_nthroot
def A085818(n): return 1 if n==1 else (f[0] if len(f:=primefactors(n))==1 and f[0]<n else prime(n-1-sum(primepi(integer_nthroot(n, k)[0]) for k in range(2, n.bit_length())))) # Chai Wah Wu, Aug 20 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 04 2003
STATUS
approved