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.

Previous Showing 71-80 of 130 results. Next

A060846 Smallest prime > the n-th nontrivial power of a prime.

Original entry on oeis.org

5, 11, 11, 17, 29, 29, 37, 53, 67, 83, 127, 127, 131, 173, 251, 257, 293, 347, 367, 521, 541, 631, 733, 853, 967, 1031, 1361, 1373, 1693, 1861, 2053, 2203, 2203, 2213, 2411, 2819, 3137, 3491, 3727, 4099, 4493, 4919, 5051, 5333, 6247, 6563, 6863, 6899, 7927
Offset: 1

Views

Author

Labos Elemer, May 03 2001

Keywords

Examples

			78125=5^7 is followed by 78137.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[Select[Range[10^4], !PrimeQ[#] && PrimePowerQ[#] &]] (* Amiram Eldar, Oct 04 2024 *)
  • PARI
    ispp(x) = !isprime(x) && isprimepower(x);
    lista(nn) = apply(x->nextprime(x), select(x->ispp(x), [1..nn])); \\ Michel Marcus, Aug 24 2019
    
  • Python
    from sympy import primepi, integer_nthroot, nextprime
    def A060846(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 nextprime(bisection(f,n,n)) # Chai Wah Wu, Sep 15 2024

Formula

a(n) = nextprime(A025475(n+1)) = A007918(A025475(n+1)) = Min{p| p>A025475(n+1)}. [corrected by Michel Marcus, Aug 24 2019]

A063932 Average of largest prime less than or equal to n and smallest prime greater than or equal to n.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 9, 9, 9, 11, 12, 13, 15, 15, 15, 17, 18, 19, 21, 21, 21, 23, 26, 26, 26, 26, 26, 29, 30, 31, 34, 34, 34, 34, 34, 37, 39, 39, 39, 41, 42, 43, 45, 45, 45, 47, 50, 50, 50, 50, 50, 53, 56, 56, 56, 56, 56, 59, 60, 61, 64, 64, 64, 64, 64, 67, 69, 69, 69, 71, 72, 73
Offset: 2

Views

Author

Henry Bottomley, Aug 21 2001

Keywords

Examples

			a(7) = (7 + 7)/2 = 7;
a(8) = (7 + 11)/2 = 9.
		

Crossrefs

Interleaving of A000040 and A001223-1 copies of A024675. Cf. A063934.

Programs

  • Mathematica
    Table[Mean[{NextPrime[n-1],NextPrime[n+1,-1]}],{n,2,80}] (* Harvey P. Dale, Nov 22 2011 *)
  • PARI
    { for (n=2, 1000, write("b063932.txt", n, " ", (precprime(n) + nextprime(n))/2) ) } \\ Harry J. Smith, Sep 02 2009

Formula

a(n) = (A007917(n) + A007918(n))/2 = n - A063933(n).

A063933 Difference between n and the average of largest prime less than or equal to n and smallest prime greater than or equal to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, -2, -1, 0, 1, 2, 0, 0, 0, -2, -1, 0, 1, 2, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, -2, -1, 0, 1, 2, 0, -2, -1, 0, 1, 2, 0, 0, 0, -2, -1, 0, 1, 2, 0, -1, 0, 1, 0, 0, 0, -2, -1, 0, 1, 2, 0, -1, 0, 1, 0, -2, -1, 0, 1, 2, 0, -3, -2, -1, 0, 1, 2, 3, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, 1, 0
Offset: 2

Views

Author

Henry Bottomley, Aug 21 2001

Keywords

Examples

			a(10) = 10 - (11 - 7)/2 = 1; a(11) = 11 - (11 + 11)/2 = 0.
		

Programs

  • PARI
    { for (n=2, 1000, write("b063933.txt", n, " ", n - (precprime(n) + nextprime(n))/2) ) } \\ Harry J. Smith, Sep 03 2009

Formula

a(n) = n - (A007917(n) + A007918(n))/2 = n - A063932(n).
a(n) = 0 for numbers in A063934 (i.e., in A000040 or A024675).

A087421 Smallest prime >= n!.

Original entry on oeis.org

2, 2, 2, 7, 29, 127, 727, 5051, 40343, 362897, 3628811, 39916801, 479001629, 6227020867, 87178291219, 1307674368043, 20922789888023, 355687428096031, 6402373705728037, 121645100408832089, 2432902008176640029, 51090942171709440031, 1124000727777607680031
Offset: 0

Views

Author

Mitch Cervinka (puritan(AT)planetkc.com), Oct 22 2003

Keywords

Comments

n! is prime only when n=2. When n>2, for n!+m to be prime, m must be relatively prime to all the numbers from 2 to n. In particular, if m is between 2 and n, then (n!+m) will be divisible by m. Thus a(n) must be either n!+1, or else larger than n!+n.

Examples

			a(0) = 2 since 0! = 1 and 2 is the smallest prime >= 1.
a(4) = 29 since 4! = 24 and 29 is the smallest prime >= 24.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Table[ NextPrim[n! - 1], {n, 0, 20}] (* Robert G. Wilson v, Oct 25 2003 *)
    Join[{2,2,2},NextPrime[Range[3,25]!]]  (* Harvey P. Dale, Feb 23 2011 *)
  • PARI
    a(n)=nextprime(n!); \\ R. J. Cano, Apr 08 2018
    
  • Python
    from sympy import factorial, nextprime
    def a(n): return nextprime(factorial(n)-1)
    print([a(n) for n in range(23)]) # Michael S. Branicky, May 22 2022

Formula

a(n) = min { p[i] | p[i]>=n! }, where p[i] is the set of prime numbers.
a(n) = A007918(A000142(n)). - Michel Marcus, Apr 09 2018

Extensions

Edited, corrected and extended by Robert G. Wilson v and Ray Chandler, Oct 25 2003

A171401 Numbers m such that exactly one editing step (insert or substitute) is necessary to transform the binary representation of m into the least prime not less than m.

Original entry on oeis.org

0, 1, 4, 6, 9, 10, 12, 16, 18, 21, 22, 25, 28, 30, 33, 36, 40, 42, 45, 46, 49, 52, 57, 58, 60, 65, 66, 69, 70, 72, 75, 77, 78, 81, 82, 88, 96, 100, 102, 105, 106, 108, 112, 119, 123, 125, 126, 129, 130, 136, 138, 145, 148, 150, 153, 156, 161, 162, 165, 166, 169, 172
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 08 2009

Keywords

Comments

A171400(a(n))=1; BinaryLevenshteinDistance(a(n),A007918(a(n)))=1;
A006093 is a subsequence apart from the second term A006093(2)=2;
A036987((a(n) XOR A007918(a(n))) - 1) = 1 for n<>2.

A308752 Integers k such that the equation A034699(k)=x has more than one solution in the range [prevprime(k), nextprime(k)].

Original entry on oeis.org

4180, 4199, 43355, 43384, 68400, 68425, 162150, 162197, 326781, 326830, 448477, 448514, 1013948, 1013985, 1060790, 1060851, 1357216, 1357299, 1373904, 1373951, 1568800, 1568853, 1928880, 1928927, 2313685, 2313744, 8752880, 8752951, 11555804, 11555901, 11962832, 11962935, 16062201, 16062280, 23120064, 23120153
Offset: 1

Views

Author

Michel Marcus, Jun 22 2019

Keywords

Comments

Is it always true that a(2*n) - a(2*n-1) = A034699(2*n) = A034699(2*n-1)? - I. V. Serov, Jun 23 2019

Examples

			A034699(4180) = A034699(4199) = 19 in the range [4177, 4201].
A034699(23120064) = A034699(23120153) = 89 in [23120039, 23120171]. - _I. V. Serov_, Jun 23 2019
		

Crossrefs

Cf. A007917 (prevprime), A007918 (nextprime), A034699.

Programs

  • PARI
    lppf(n) = if(1==n, n, my(f=factor(n)); vecmax(vector(#f[, 1], i, f[i, 1]^f[i, 2]))); \\ A034699
    lista(nn) = {for (n=1, nn, my(p = prime(n), q = nextprime(p+1)); my(v = vector(q-p-1, k, lppf(k+p)), vs = vecsort(v,,8)); if (#v != #vs, for (i=1, #vs, my(vx = select(x->(x==vs[i]), v, 1)); if (#vx > 1, for (j=1, #vx, print1(p+vx[j], ", "));););););}

Extensions

a(35)-a(36) from I. V. Serov, Jun 23 2019

A056140 a(n) = n^2 - previousprime(n)*nextprime(n), for n>2.

Original entry on oeis.org

-1, 1, 4, 1, -6, -13, 4, 23, 30, 1, -18, -25, 4, 35, 42, 1, -30, -37, 4, 47, -22, -91, -42, 9, 62, 117, 128, 1, -112, -123, -58, 9, 78, 149, 98, -73, 4, 83, 90, 1, -78, -85, 4, 95, -70, -187, -90, 9, 110, 213, 36, -211, -102, 9, 122, 237, 248, 1, -232, -243
Offset: 3

Views

Author

Henry Bottomley, Jun 15 2000

Keywords

Comments

a(n) is never 0.

Examples

			a(3)=3^2-2*5=-1, a(4)=4^2-3*5=1.
		

Crossrefs

Programs

  • Mathematica
    Table[n^2-NextPrime[n]NextPrime[n,-1],{n,3,80}] (* Harvey P. Dale, Aug 22 2011 *)
  • PARI
    a(n) = n^2 - precprime(n-1)*nextprime(n+1); \\ Michel Marcus, Mar 22 2020

Formula

a(n) = n^2-A007917(n-1)*A007918(n+1) = A000290(n)-A013638(n).

Extensions

More terms from Harvey P. Dale, Aug 22 2011

A056141 a(n) = primefloor(n)*primeceiling(n) - previousprime(n)*nextprime(n).

Original entry on oeis.org

-1, 0, 4, 0, -6, 0, 0, 0, 30, 0, -18, 0, 0, 0, 42, 0, -30, 0, 0, 0, -22, 0, 0, 0, 0, 0, 128, 0, -112, 0, 0, 0, 0, 0, 98, 0, 0, 0, 90, 0, -78, 0, 0, 0, -70, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 248, 0, -232, 0, 0, 0, 0, 0, 158, 0, 0, 0, 150, 0, -280, 0, 0, 0, 0, 0, 182
Offset: 3

Views

Author

Henry Bottomley, Jun 15 2000

Keywords

Examples

			a(3)=3*3-2*5=-1, a(4)=3*5-3*5=0
		

Crossrefs

Cf. A056221 (nonzero terms).

Programs

  • PARI
    a(n) = if (isprime(n), n^2 - precprime(n-1)*nextprime(n+1), 0); \\ Michel Marcus, Mar 22 2020

Formula

a(n) = A007917(n)*A007918(n) - A007917(n-1)*A007918(n+1).
a(n) = A030664(n) - A013638(n).
a(n) = A056140(n) - A056139(n).
a(n) = A056140(n) if n is prime, a(n)=0 otherwise.

Extensions

More terms from Michel Marcus, Mar 22 2020

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

A063766 a(n) is the smallest prime >= 6^n.

Original entry on oeis.org

2, 7, 37, 223, 1297, 7789, 46663, 279941, 1679627, 10077721, 60466181, 362797091, 2176782371, 13060694051, 78364164101, 470184984667, 2821109907503, 16926659444771, 101559956668421, 609359740010513, 3656158440062987, 21936950640377863, 131621703842267239
Offset: 0

Views

Author

Robert G. Wilson v, Aug 14 2001

Keywords

Crossrefs

Programs

  • Magma
    [NextPrime(6^n): n in [0..25]];// Vincenzo Librandi, Jun 25 2018
  • Mathematica
    NextPrime[ n_Integer ] := (k = n + 1; While[ !PrimeQ[ k ], k++ ]; k); Table[ NextPrime[ 6^n ], {n, 0, 22} ]
    NextPrime[6^Range[0, 25]] (* Vincenzo Librandi, Jun 25 2018 *)
  • PARI
    { for (n=0, 200, write("b063766.txt", n, " ", nextprime(6^n)); ) } \\ Harry J. Smith, Aug 30 2009
    

Formula

a(n) = A007918(A000400(n)). - Michel Marcus, Jun 25 2018
Previous Showing 71-80 of 130 results. Next