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 21-30 of 31 results. Next

A104094 Largest prime <= 9^n.

Original entry on oeis.org

7, 79, 727, 6553, 59029, 531383, 4782961, 43046623, 387420479, 3486784393, 31381059607, 282429536453, 2541865828309, 22876792454939, 205891132094623, 1853020188851807, 16677181699666513, 150094635296999111
Offset: 1

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Cf. A013604.
Largest prime <= b^n: 2^n-A013603(n), 3^n-A013604(n), 4^n-A013606(n), 5^n-A013605(n), 6^n-A013607(n), 7^n-A013608(n), 8^n-A013603(3*n), 10^n-A033874(n).

Programs

  • Maple
    f:= n -> prevprime(9^n):
    map(f, [$1..30]); # Robert Israel, Aug 12 2019
  • Mathematica
    NextPrime[#,-1]&/@(9^Range[20]) (* Harvey P. Dale, Apr 21 2024 *)
  • PARI
    g(n,b) = for(x=0,n,print1(precprime(b^x)","))

Formula

a(n) = 9^n - A013604(2*n) = A001019(n) - A013604(2*n), n > 0. A.H.M. Smeets, Aug 12 2019

A226178 Exponents n such that 2^n - previous_prime(2^n) = next_prime(2^n) - 2^n.

Original entry on oeis.org

2, 6, 12, 76, 181, 1099, 1820, 9229
Offset: 1

Views

Author

Jean-François Alcover, May 30 2013

Keywords

Comments

The differences next_prime(2^n) - 2^n are respectively: 1, 3, 3, 15, 165, 1035, 663, 2211.
If it exists, a(9) > 10000. - Hugo Pfoertner, Feb 06 2021

Examples

			2^6 = 64, next prime = 67, previous prime = 61, 67-64 = 64-61 = 3, hence 6 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Reap[Do[m = 2^n; p = NextPrime[m, -1]; q = NextPrime[m]; If[p + q == 2*m, Print[n]; Sow[n]], {n, 2, 10^4}]][[2, 1]]
  • PARI
    isok(n) = my(p=2^n); p-precprime(p-1) == nextprime(p+1) - p; \\ Michel Marcus, Oct 02 2019
    
  • PARI
    for(n=2,1100,my(p2=2^n,pn=nextprime(p2),pp=p2-pn+p2);if(ispseudoprime(pp),if(precprime(p2)==pp,print1(n,", ")))) \\ Hugo Pfoertner, Feb 06 2021
    
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def A226178_gen(): # generator of terms
        return filter(lambda n:isprime(r:=((k:=1<A226178_list = list(islice(A226178_gen(),5)) # Chai Wah Wu, Aug 08 2022

Formula

A340707(a(n)) = 0. - Hugo Pfoertner, Feb 06 2021

Extensions

Offset 1 from Michel Marcus, Oct 02 2019
a(8) from Hugo Pfoertner, Feb 05 2021

A340707 a(n) = (prevprime(2^n) + nextprime(2^n))/2 - 2^n where prevprime(n) = A151799(n) and nextprime(n) = A151800(n).

Original entry on oeis.org

0, 1, -1, 2, 0, 1, -2, 3, 2, -2, 0, 8, 12, -8, -7, 14, -1, 10, 2, 4, 6, -3, 20, -2, 5, -5, -27, 4, -16, 5, 5, 4, -8, 11, 13, -8, -19, 8, -36, 3, 2, -14, -5, 2, -3, -55, -19, -6, 14, -54, -13, -53, 63, -26, 38, -2, 21, 38, -30, 7, 39, 2, -23, 41, 2, -8, 5, 5, -5, -110
Offset: 2

Views

Author

Hugo Pfoertner, Jan 29 2021

Keywords

Comments

a(n) > 0 if the difference nextprime(2^n) - 2^n = A013597(n) is greater than the difference 2^n - previousprime(2^n) = A013603(n).

Examples

			a(4) = -1: 2^4 = 16, (13 + 17 - 32)/2 = -1;
a(5) = 2: 2^5 = 32, (31 + 37 - 64)/2 = 2;
a(6) = 0: 2^6 = 64, (61 + 67 - 128)/2 = 0.
		

Crossrefs

Programs

  • Maple
    a:= (p-> (nextprime(p)+prevprime(p))/2-p)(2^n):
    seq(a(n), n=2..75);  # Alois P. Heinz, Jan 29 2021
  • Mathematica
    Array[(NextPrime[2^#] + NextPrime[2^#, -1] - 2^(# + 1))/2 &, 60, 2] (* Michael De Vlieger, Aug 07 2022 *)
  • PARI
    for(k=2,71,my(p2=2^k,pp=precprime(p2),pn=nextprime(p2));if(print1((pp+pn-2*p2)/2", ")))

Formula

a(n) = (A013597(n) - A013603(n))/2.
a(A226178(n)) = 0.

Extensions

Name made more precise by Peter Luschny, Aug 08 2022

A113213 Smallest number m such that 2^n - m and 2^n + m are primes.

Original entry on oeis.org

0, 1, 3, 3, 9, 3, 21, 15, 9, 15, 21, 3, 45, 135, 75, 15, 99, 93, 99, 315, 105, 105, 15, 75, 339, 117, 261, 183, 351, 453, 1281, 267, 675, 867, 819, 117, 69, 2343, 1995, 1005, 2949, 165, 741, 603, 315, 1287, 1629, 243, 519, 765, 165, 1233, 741, 1797, 339, 177
Offset: 1

Views

Author

Zak Seidov, Jan 07 2006

Keywords

Comments

For n>=3 all terms are multiples of 3.
Conjecture: a(n) = O(n^3). - Thomas Ordowski, Apr 20 2015

Examples

			a(1)=0 because 2^1 +/- 0 are primes; a(2)=1 because 2^2 -/+ 1 are primes;
a(33)=675 because 2^33 +/- 675 are closest (to each other) primes.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{a=2^n,i=1},While[!PrimeQ[a+i]||!PrimeQ[a-i],i++];i]; Join[{0},Rest[Array[f,80]]]  (* Harvey P. Dale, Apr 25 2011 *)
  • PARI
    a(n) = my(m=0); while(!(isprime(2^n+m) && isprime(2^n-m)), m++); m; \\ Michel Marcus, Apr 20 2015

A268607 a(n) is the least m > 1 such that 2^n - m is prime.

Original entry on oeis.org

2, 3, 3, 3, 3, 15, 5, 3, 3, 9, 3, 13, 3, 19, 15, 9, 5, 19, 3, 9, 3, 15, 3, 39, 5, 39, 57, 3, 35, 19, 5, 9, 41, 31, 5, 25, 45, 7, 87, 21, 11, 57, 17, 55, 21, 115, 59, 81, 27, 129, 47, 111, 33, 55, 5, 13, 27, 55, 93, 31, 57, 25, 59, 49, 5, 19, 23, 19, 35, 231, 93
Offset: 2

Views

Author

Alexei Kourbatov, Feb 08 2016

Keywords

Comments

a(1) is not defined (there are no primes less than 2).
The definition is similar to Lesser Fortunate numbers (A055211) but uses 2^n instead of primorials A002110(n).

Examples

			a(7)=15 because m=15 is the least m > 1 such that 2^7 - m is prime.
		

Crossrefs

Programs

  • Mathematica
    Map[# - NextPrime[#-1, -1] &, 2^Range[2, 100]] (* Paolo Xausa, Mar 10 2025 *)
  • PARI
    a(n)=2^n-precprime(2^n-2)

Formula

a(n) = A013603(n), if A013603(n) > 1. - Jason Yuen, Mar 10 2025

A360080 Smallest k such that 2^(2^n) + k is a safe prime.

Original entry on oeis.org

1, 7, 7, 7, 91, 3103, 12451, 230191, 286867, 1657867, 10029811, 29761351, 22410151, 98402791, 167137543
Offset: 1

Views

Author

Mark Andreas, Jan 25 2023

Keywords

Comments

a(n) == 3 (mod 4) for n > 1. - Chai Wah Wu, Jan 27 2023

Examples

			a(3) = 7 because 2^(2^3) + 7 = 263 is the smallest safe prime greater than 256.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); pow2 = 2^(2^n);   while (!(isprime(pow2 + k) && isprime((pow2 + k - 1)/2)), k+=2); k;} \\
    
  • Python
    from sympy import isprime, nextprime
    def A360080(n):
        if n <= 1: return 1
        m = 1<<(1<Chai Wah Wu, Jan 27 2023

Formula

a(n) = A350696(2^n).

A360081 Smallest k such that 2^(3*2^n) + k is a safe prime.

Original entry on oeis.org

3, 19, 31, 691, 907, 2887, 15943, 69283, 216127, 1108831, 8344423, 10976347, 166965391, 385465771, 26580643
Offset: 0

Views

Author

Mark Andreas, Jan 25 2023

Keywords

Comments

a(n) == 3 (mod 4). - Chai Wah Wu, Jan 27 2023

Examples

			a(1) = 19 because 2^(3*2^1)+19 = 2^6+19 = 83 is the smallest safe prime greater than 64.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); pow2 = 2^(3*2^n); while (!(isprime(pow2 + k) && isprime((pow2 + k - 1)/2)), k+=2); k;} \\
    
  • Python
    from sympy import isprime, nextprime
    def A360081(n):
        m = 1<<3*(1<Chai Wah Wu, Jan 27 2023

Formula

a(n) = A350696(3*2^n).

A373124 Sum of indices of primes between powers of 2.

Original entry on oeis.org

1, 2, 7, 11, 45, 105, 325, 989, 3268, 10125, 33017, 111435, 369576, 1277044, 4362878, 15233325, 53647473, 189461874, 676856245, 2422723580, 8743378141, 31684991912, 115347765988, 421763257890, 1548503690949, 5702720842940, 21074884894536, 78123777847065
Offset: 0

Views

Author

Gus Wiseman, May 31 2024

Keywords

Comments

Sum of k such that 2^n+1 <= prime(k) <= 2^(n+1).

Examples

			Row-sums of the sequence of all positive integers as a triangle with row-lengths A036378:
   1
   2
   3  4
   5  6
   7  8  9 10 11
  12 13 14 15 16 17 18
  19 20 21 22 23 24 25 26 27 28 29 30 31
  32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
		

Crossrefs

For indices of primes between powers of 2:
- sum A373124 (this sequence)
- length A036378
- min A372684 (except initial terms), delta A092131
- max A007053
For primes between powers of 2:
- sum A293697
- length A036378
- min A104080 or A014210
- max A014234, delta A013603
For squarefree numbers between powers of 2:
- sum A373123
- length A077643, run-lengths of A372475
- min A372683, delta A373125, indices A372540
- max A372889, delta A373126, indices A143658

Programs

  • Mathematica
    Table[Total[PrimePi/@Select[Range[2^(n-1)+1,2^n],PrimeQ]],{n,10}]
  • PARI
    ip(n) = primepi(1<A007053
    t(n) = n*(n+1)/2; \\ A000217
    a(n) = t(ip(n+1)) - t(ip(n)); \\ Michel Marcus, May 31 2024

A074717 Least k such that floor(2^n/k) is prime.

Original entry on oeis.org

1, 2, 3, 3, 6, 9, 11, 11, 7, 9, 5, 10, 19, 11, 5, 10, 9, 11, 22, 35, 39, 9, 5, 10, 20, 27, 11, 19, 9, 18, 36, 25, 29, 27, 5, 10, 20, 40, 61, 13, 21, 42, 29, 27, 39, 9, 17, 29, 58, 49, 27, 25, 50, 11, 22, 44, 39, 11, 22, 44, 29, 58, 116, 53, 19, 38, 76, 152, 237, 139, 5, 10, 20
Offset: 1

Views

Author

Benoit Cloitre, Sep 04 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[! PrimeQ @ Floor[2^n/k], k++]; k]; Array[a, 100] (* Amiram Eldar, Aug 31 2020 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(floor(2^n/k)) == 0,k++); k)

Formula

There is probably a constant c such that Sum_{i=1..n} a(i) is asymptotic to c*n^2 (0 < c < 1/2).

A185191 a(n) = 2^n - second largest prime less than 2^n.

Original entry on oeis.org

2, 3, 5, 3, 5, 15, 15, 9, 5, 19, 5, 13, 15, 49, 17, 9, 11, 19, 5, 19, 17, 21, 17, 49, 27, 79, 89, 33, 41, 19, 17, 25, 77, 49, 17, 31, 87, 19, 167, 31, 17, 67, 117, 69, 57, 127, 65, 111, 35, 139, 143, 145, 53, 67, 27, 25, 57, 99, 107, 31, 87, 165, 83
Offset: 2

Views

Author

Washington Bomfim, Jan 23 2012

Keywords

Examples

			a(2)=2 because precprime(4)=3, and precprime(2)=2.
		

References

  • D. E. Knuth, The Art of Computer Programming Second Edition. Vol. 2, Seminumerical Algorithms. Chapter 4.5.4 Factoring into Primes, Table 1, Page 390, Addison-Wesley, Reading, MA, 1981.

Crossrefs

Cf. A013603.

Programs

  • Mathematica
    Table[2^n - NextPrime[2^n, -2], {n, 2, 64}] (* T. D. Noe, Jan 24 2012 *)
    #-NextPrime[#,-2]&/@(2^Range[2,70]) (* Harvey P. Dale, Mar 29 2025 *)

Formula

a(n) = 2^n - precprime(precprime(2^n)-1)
Previous Showing 21-30 of 31 results. Next