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-3 of 3 results.

A056206 Smallest prime p such that p + 2^n is also a prime.

Original entry on oeis.org

2, 3, 3, 3, 3, 5, 3, 3, 7, 11, 7, 5, 3, 17, 37, 3, 3, 29, 3, 53, 7, 17, 67, 11, 43, 41, 97, 29, 3, 11, 3, 11, 61, 17, 79, 53, 31, 29, 7, 23, 97, 71, 277, 29, 7, 59, 127, 5, 61, 191, 193, 101, 37, 5, 163, 3, 97, 131, 577, 131, 151, 197, 193, 29, 13, 131, 709, 3, 61
Offset: 0

Views

Author

Labos Elemer, Oct 06 2000

Keywords

Examples

			n=9, 512 + {2,3,5,7,11,...} = {514,515,519,523,...} = {2*257, 5*103, 11*47, 3*173, 523=prime, ...}. The smallest suitable prime is 11 and it gives 523 = 512 + 11. So a(9)=11.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local o, p; o, p:=2^n, 2;
          while not isprime(o+p) do p:= nextprime(p) od; p
        end:
    seq(a(n), n=0..75);  # Alois P. Heinz, Mar 20 2023
  • Mathematica
    Table[i=1; While[!PrimeQ[2^n+(p=Prime[i])],i++]; p,{n,0,72}] (* Jayanta Basu, May 23 2013 *)

Formula

a(n) = Min{p|p+2^n=q, both p and q are primes}.

Extensions

a(0) from Jayanta Basu, May 23 2013

A381041 Smallest prime p such that 3^n + p + 1 is prime.

Original entry on oeis.org

3, 3, 3, 3, 7, 7, 3, 19, 7, 3, 3, 19, 79, 7, 7, 43, 67, 139, 127, 103, 7, 97, 3, 31, 31, 13, 379, 61, 109, 433, 3, 79, 127, 79, 67, 139, 127, 229, 7, 109, 271, 313, 3, 151, 7, 103, 67, 283, 421, 67, 43, 373, 97, 97, 97, 19, 61, 3, 157, 331, 127, 37, 139, 439, 421
Offset: 0

Views

Author

James S. DeArmon, Apr 20 2025

Keywords

Examples

			a(0) = 3, since 3 + (3^0+1) = 5 is prime and 2 + (3^0+1) = 4 is not.
a(1) = 3, since 3 + (3^1+1) = 7 is prime and 2 + (3^1+1) = 6 is not.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,p;
     p:= 1: t:= 3^n+1;
     do
       p:= nextprime(p);
       if isprime(p+t) then return p fi
     od;
    end proc:
    map(f, [$0..100]); # Robert Israel, Jun 19 2025
  • Mathematica
    a[n_]:=Module[{p=2},While[!PrimeQ[p+3^n+1], p=NextPrime[p]]; p]; Array[a,65,0] (* Stefano Spezia, Apr 25 2025 *)
  • PARI
    a(n) = my(p=2, x=3^n+1); while (!isprime(p+x), p=nextprime(p+1)); p; \\ Michel Marcus, Apr 24 2025
  • Python
    from sympy import isprime, nextprime
    def a(n):
        p, b = 2, 3**n+1
        while not isprime(p+b):
            p = nextprime(p)
        return p
    print([a(n) for n in range(65)]) # Michael S. Branicky, Apr 23 2025
    
  • Python
    from sympy import nextprime, isprime
    def A381041(n):
        p = 3**n+1
        q = nextprime(p)
        while not isprime(q-p):
            q = nextprime(q)
        return q-p # Chai Wah Wu, May 01 2025
    

Formula

a(n) = A020483(A007051(n)). - Robert Israel, Jun 19 2025

Extensions

More terms from Michael S. Branicky, Apr 23 2025

A295111 Primes p such that 2^p - p is also a prime.

Original entry on oeis.org

2, 3, 13, 19, 481801
Offset: 1

Views

Author

Iain Fox, Nov 14 2017

Keywords

Comments

a(6) > 1061095.
Intersection of A000040 and A048744.
Since numbers other than 3 that are congruent to 3 mod 6 are composite, for n > 2, a(n) is congruent to 1 mod 6 (see comments by Iain Fox in A048744).

Examples

			p=13, 2^13 - 13 = 8179 is prime.
		

Crossrefs

Programs

  • PARI
    lista(nn) = forprime(p=2, nn, if(ispseudoprime(2^p - p), print1(p, ", ")))
Showing 1-3 of 3 results.