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.

A196667 The Chebyshev primes of index 1.

Original entry on oeis.org

109, 113, 139, 181, 197, 199, 241, 271, 281, 283, 293, 313, 317, 443, 449, 461, 463, 467, 479, 491, 503, 509, 523, 619, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 761, 769, 773, 829, 859, 863, 883, 887, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1091, 1093, 1097
Offset: 1

Views

Author

Michel Planat, Oct 05 2011

Keywords

Comments

The sequence consists of the odd prime numbers p that satisfy li[psi(p)]-li[psi(p-1)]<1, where li(x) is the logarithmic integral and psi(x) is the Chebyshev's psi function.

Crossrefs

Programs

  • Magma
    Mangoldt:=function(n);
    if #Factorization(n) eq 1 then return Log(Factorization(n)[1][1]); else return 0; end if;
    end function;
    tcheb:=function(n);
    x:=0;
    for i in [1..n] do
    x:=x+Mangoldt(i);
    end for;
    return(x);
    end function;
    jump1:=function(n);
    x:=LogIntegral(tcheb(NthPrime(n)))-LogIntegral(tcheb(NthPrime(n)-1));
    return x;
    end function;
    Set1:=[];
    for i in [2..1000] do
    if jump1(i)-1 lt 0 then Set1:=Append(Set1,NthPrime(i)); NthPrime(i); end if;
    end for;
    Set1;
    
  • Maple
    PlanatSole := proc(n,r) local j, p, pr, psi, L; L := NULL;
    psi := n -> add(log(i/ilcm(op(numtheory[divisors](i) minus {1,i}))),i=1..n);
    for j in [$3..n] do p := ithprime(j); pr := p^r;
    if evalf(Li(psi(pr))-Li(psi(pr-1))) < 1/r then L:= L,p fi od; L end:
    A196667 := n -> PlanatSole(n,1); # Peter Luschny, Oct 23 2011
  • Mathematica
    ChebyshevPsi[n_] := Log[LCM @@ Range[n]];
    Reap[Do[If[LogIntegral[ChebyshevPsi[p]] - LogIntegral[ChebyshevPsi[p - 1]] < 1, Sow[p]], {p, Prime[Range[2, 200]]}]][[2, 1]] (* Jean-François Alcover, Nov 17 2017, updated Dec 06 2018 *)
  • Perl
    use ntheory ":all"; forprimes { say if LogarithmicIntegral(chebyshev_psi($))-LogarithmicIntegral(chebyshev_psi($-1)) < 1 } 3,1000; # Dana Jacobsen, Dec 29 2015
  • Sage
    from mpmath import mp, mangoldt
    mp.dps = 25;
    def psi(n) :
        return sum(mangoldt(i) for i in (1..n))
    def PlanatSole(n,r) :
        P = Primes(); L = []
        for j in (2..n):
            p = P.unrank(j)
            pr = p^r
            if Li(psi(pr)) - Li(psi(pr-1)) < 1/r :
               L.append(p)
        return L
    def A196667List(n) : return PlanatSole(n,1)
    A196667List(100) # Peter Luschny, Oct 23 2011