login
A339872
Index k of the least prime(k) such that prime(k)-adic valuation of phi(n) exceeds the prime(k)-adic valuation of n-1, or 0 if no such k exists (for example, when n = 1 or a prime).
2
0, 0, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 2, 1, 0, 1, 3, 1, 2, 1, 0, 1, 0, 1, 3, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 4, 1, 1, 1, 0, 1, 1, 1, 2, 1, 0, 1, 0, 1, 1, 1, 2, 1, 0, 1, 5, 1, 0, 1, 0, 1, 1, 1, 2, 1, 0, 1, 2, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1
OFFSET
1,9
LINKS
FORMULA
a(n) = A055396(A160595(n)).
PROG
(PARI) A339872(n) = if(1==n, 0, for(k=1, n, my(p=prime(k)); if(valuation(eulerphi(n), p)>valuation(n-1, p), return(k))); (0));
(PARI) A339872(n) = if(1==n, 0, my(f=factor(eulerphi(n))); for(i=1, #f~, if(f[i, 2]>valuation(n-1, f[i, 1]), return(primepi(f[i, 1])))); (0));
(PARI) A339872(n) = { my(t=eulerphi(n), x=t/gcd(n-1, t)); if(1==x, 0, primepi(factor(x)[1, 1])); };
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 20 2020
STATUS
approved