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.

Showing 1-2 of 2 results.

A068435 Consecutive prime powers without a prime between them.

Original entry on oeis.org

8, 9, 25, 27, 121, 125, 2187, 2197, 32761, 32768
Offset: 1

Views

Author

Jon Perry, Mar 09 2002

Keywords

Comments

From David A. Corneth, Aug 24 2019: (Start)
Only 5 pairs are known up to 4*10^18. Legendre's conjecture states that there is a prime number between n^2 and (n + 1)^2 for every positive integer n. The conjecture has been verified up to n = 2*10^9. So to that bound we only have to check for two prime powers where at least one has an exponent of at least 3. That has been done to prime powers <= 10^22.
If there is another pair besides the first five listed with both numbers <= 10^22 then Legendre's conjecture is false.
Proof: If there is another such pair with both numbers <= 10^22 then it must be of the form [p^2, q^2] where p is a prime and q is the least prime larger than p. Then q - p >= 2 (as p != 2). So there is no prime between p^2 and q^2 and hence there is no prime between p^2 and (p+1)^2. This is a counterexample to Legendre's conjecture. (End)

Examples

			8 = 2^3, 9 = 3^2, there is no prime between 8 and 9.
25 = 5^2, 27 = 3^3, there is no prime between 25 and 27.
		

Crossrefs

Cf. A116086 and A116455 (for perfect powers, but not necessarily prime powers).

Programs

  • Mathematica
    With[{upto=33000},Select[Partition[Select[Range[upto],PrimePowerQ],2,1],NoneTrue[#,PrimeQ]&]] (* Paolo Xausa, Oct 29 2023 *)
  • PARI
    ispp(x) = !isprime(x) && isprimepower(x);
    lista(nn=50000) = {my(prec = 0); for (i=1, nn, if (ispp(i), if (! prec, prec = i, if (primepi(i) == primepi(prec), print1(prec, ", ", i, ", ")); prec = i;);););} \\ Michel Marcus, Aug 24 2019

A060845 Largest prime < a nontrivial power of a prime.

Original entry on oeis.org

3, 7, 7, 13, 23, 23, 31, 47, 61, 79, 113, 113, 127, 167, 241, 251, 283, 337, 359, 509, 523, 619, 727, 839, 953, 1021, 1327, 1367, 1669, 1847, 2039, 2179, 2179, 2207, 2399, 2803, 3121, 3469, 3719, 4093, 4483, 4909, 5039, 5323, 6229, 6553, 6857, 6883, 7919
Offset: 1

Views

Author

Labos Elemer, May 03 2001

Keywords

Examples

			78125=5^7 follows 78121
		

Crossrefs

Programs

  • Mathematica
    Take[NextPrime[#,-1]&/@Union[Flatten[Table[Prime[p]^n,{n,2,20},{p,25}]]], 50] (* Harvey P. Dale, Mar 26 2012 *)
  • PARI
    { m=1; for (n=1, 1000, m++; while(sigma(m)*eulerphi(m)*(1 - isprime(m)) <= (m - 1)^2, m++); write("b060845.txt", n, " ", precprime(m - 1)); ) } \\ Harry J. Smith, Jul 19 2009
    
  • Python
    from sympy import primepi, integer_nthroot, prevprime
    def A060845(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())))
        return prevprime(bisection(f,n,n)) # Chai Wah Wu, Sep 15 2024

Formula

a(n) = prevprime[A025475(n)] = A007917[A025475(n)] = Max{p| p < A025475(n)}
Showing 1-2 of 2 results.