cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 20 2020

Keywords

Crossrefs

Programs

  • 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])); };

Formula

a(n) = A055396(A160595(n)).