OFFSET
1,3
LINKS
FORMULA
EXAMPLE
For n = 8 = 2*2*2 = prime(1)^3, the exponent of the least (and the only) prime factor 2 is 3, an odd number, thus a(8) = 1 as 2 = prime(1).
PROG
(Scheme, two implementations)
(definec (A277707 n) (cond ((= 1 n) 0) ((odd? (A067029 n)) (A055396 n)) (else (A277707 (A028234 n)))))
(PARI) a(n) = my(f = factor(core(n))); if (!#f~, 0, primepi(vecmin(f[, 1]))); \\ Michel Marcus, Oct 30 2016
(Python)
from sympy import primepi, isprime, primefactors
from sympy.ntheory.factor_ import core
def a049084(n): return primepi(n)*(1*isprime(n))
def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
def a(n): return a055396(core(n)) # Indranil Ghosh, May 17 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 28 2016
STATUS
approved