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-10 of 13 results. Next

A056208 Primes p+2^n arising in A056206.

Original entry on oeis.org

3, 5, 7, 11, 19, 37, 67, 131, 263, 523, 1031, 2053, 4099, 8209, 16421, 32771, 65539, 131101, 262147, 524341, 1048583, 2097169, 4194371, 8388619, 16777259, 33554473, 67108961, 134217757, 268435459, 536870923, 1073741827, 2147483659
Offset: 0

Views

Author

Labos Elemer, Oct 06 2000

Keywords

Examples

			n=13, 2^13+p=8192+p is not prime for p=2,3,5,7,11,13. At first, for p=17, 8209 is prime; Primes obtained also for many larger p, the next is 8221. So a(13)=8209, the smallest one.
		

Crossrefs

Cf. A056206.

Programs

  • Maple
    f:= proc(n) local p,q,t;
      t:= 2^n; p:= 1;
      do
        p:= nextprime(p);
        q:= p+t;
        if isprime(q) then return q fi
      od
    end proc:
    map(f, [$0..50]); # Robert Israel, Aug 22 2019
  • Mathematica
    a[n_] := Module[{p = 1, q, t = 2^n}, While[True, p = NextPrime[p]; q = p+t; If[PrimeQ[q], Return[q]]]];
    a /@ Range[0, 50] (* Jean-François Alcover, Jun 09 2020, after Maple *)

Extensions

a(0)=3 inserted by Robert Israel, Aug 22 2019

A057663 Primes p such that p + 2^p is also a prime.

Original entry on oeis.org

3, 5, 89, 317, 701
Offset: 1

Views

Author

Labos Elemer, Oct 16 2000

Keywords

Comments

Different from A056206, where, e.g., at n=89, 89 is not minimal, A056206(89)=29 and not 89.
a(6) > 27479. - Ralf Stephan, Oct 23 2002
Intersection of A000040 and A052007. - Iain Fox, Nov 08 2017
a(6) > 678561. - Iain Fox, Nov 08 2017
Every term other than 3 is congruent to 5 (mod 6). - Arkadiusz Wesolowski, Nov 14 2017
These terms satisfy phi(k + 2^k) = phi(k) + 2^k, where phi is A000010, the Euler totient function. Conjecture: this sequence gives all numbers k that satisfy the condition phi(k + 2^k) = phi(k) + 2^k. - Juri-Stepan Gerasimov, May 23 2019

Examples

			q=3, 2^3 + 3 = 11 a prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(1000) | IsPrime(2^p+p) ] // Vincenzo Librandi, Aug 07 2010
    
  • Mathematica
    Select[Prime@ Range[10^3], PrimeQ[# + 2^#] &] (* Michael De Vlieger, Nov 08 2017 *)
  • PARI
    lista(nn) = forprime(p=3, nn, if(ispseudoprime(p + 2^p), print1(p, ", "))) \\ Iain Fox, Nov 13 2017
    
  • Sage
    [n for n in (1..1000) if is_prime(n) and is_prime(2^n+n)] # G. C. Greubel, May 24 2019

A242944 Primes prime(k) such that 2^k + prime(k) is also prime.

Original entry on oeis.org

3, 5, 7, 11, 37, 41, 43, 83, 269, 577, 1429, 1433, 2063, 2549, 8353, 10639, 15299, 16927, 18637, 20201, 24007, 30097, 34039, 41777, 146609, 394249, 839203, 2955319
Offset: 1

Views

Author

Robert G. Wilson v, Jun 20 2014

Keywords

Comments

If instead we ask for odd primes, and therefore the index is one less than that for all primes, the sequence would begin: 3, 29, 89, 251, 659, 937, 1307, 1453, 8179, 9391, 12097, 28499, 83969, 101209, 120739, ..., .
If we count 1 amongst the primes (A008578), then the sequence would begin: 1, 3, 31, 71, 97, 107, 277, 307, 641, 907, 967, 1009, 1447, 3463, 3527, 7757, 8167, ..., .

Crossrefs

Corresponding k are in A077375.

Programs

  • Mathematica
    p = 2; lst = {}; While[p < 760001, If[ PrimeQ[p + 2^PrimePi@ p], AppendTo[ lst, p]; Print@ p]; p = NextPrime@ p; c++]; lst
    Select[Table[{n,Prime[n]},{n,3000}],PrimeQ[#[[2]]+2^#[[1]]]&][[;;,2]] (* The program generates the first 21 terms of the sequence. *) (* Harvey P. Dale, Mar 04 2024 *)

Extensions

a(27) from Michael S. Branicky, May 29 2025 using A077375.
a(28) from Michael S. Branicky, Jun 01 2025

A057673 Smallest prime p such that |2^n - p| is a prime.

Original entry on oeis.org

3, 5, 2, 3, 3, 3, 3, 19, 5, 3, 3, 19, 3, 13, 3, 19, 17, 13, 5, 19, 3, 19, 3, 37, 3, 61, 5, 79, 89, 3, 41, 19, 5, 79, 41, 31, 5, 31, 107, 7, 167, 31, 11, 67, 17, 139, 167, 127, 59, 139, 71, 139, 47, 379, 53, 67, 5, 13, 137, 607, 107, 31, 167, 409, 59, 79, 5, 19, 23, 19, 71, 577, 107
Offset: 0

Views

Author

Labos Elemer, Oct 19 2000

Keywords

Comments

The absolute value is relevant only for first two terms, 2^0-a(0) = 1-3 = -2, 2^1-a(1) = 2-5 = -3. According to Goldbach's conjecture, every even number > 2 is the sum of two primes, which implies that for all further terms, a(n) < 2^n. - M. F. Hasler, Jan 13 2011

Examples

			n=7, 2^n=128. The smallest terms subtracted from 128 resulting in a prime are 1,15,19,... Neither 1 nor 15 are primes but 19 is a prime. It gives 109=128-19, so a(n)=19.
		

Crossrefs

Analog of A056206. Cf. A056208, A057662.

Programs

  • Mathematica
    f[n_] := Block[{p = 2}, While[! PrimeQ[2^n - p], p = NextPrime@ p]; p]; Array[f, 60, 0]
  • PARI
    A057673(n)=forprime( p=1,default(primelimit), ispseudoprime(abs(2^n-p))& return(p))

Extensions

Offset corrected and initial term added by M. F. Hasler, Jan 13 2011

A057662 Smallest prime q such that q + 2^prime(n) is a prime, where prime(n) is the n-th prime.

Original entry on oeis.org

3, 3, 5, 3, 5, 17, 29, 53, 11, 11, 11, 29, 71, 29, 5, 5, 131, 197, 3, 11, 29, 23, 89, 29, 359, 149, 239, 239, 881, 281, 29, 3449, 197, 683, 389, 683, 101, 1283, 83, 191, 1181, 197, 5, 71, 107, 101, 71, 4001, 1433, 251, 431, 29, 1361, 89, 509, 83, 2459, 941, 101, 197
Offset: 1

Views

Author

Labos Elemer, Oct 16 2000

Keywords

Examples

			For n = 6, prime(6) = 13, 8192 + 17 = 8209 is a prime but 8192 + 2, 8182 + 3, ..., 8192 + 13 are not, so a(6) = 17.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{m = 2^Prime[n], q = 2}, While[!PrimeQ[q + m], q = NextPrime[q]]; q]; Array[a, 60] (* Amiram Eldar, Mar 13 2025 *)
  • PARI
    a(n) = my(P=2^prime(n), q=2); while (!isprime(P+q), q = nextprime(q+1)); q; \\ Michel Marcus, Mar 04 2022

Formula

a(n) = A056206(A000040(n)).

A361679 A(n,k) is the n-th prime p such that p + 2^k is also prime; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

3, 3, 5, 3, 7, 11, 3, 5, 13, 17, 5, 7, 11, 19, 29, 3, 11, 13, 23, 37, 41, 3, 7, 29, 31, 29, 43, 59, 7, 11, 19, 41, 37, 53, 67, 71, 11, 13, 23, 37, 47, 43, 59, 79, 101, 7, 29, 37, 29, 43, 71, 67, 71, 97, 107, 5, 37, 59, 61, 53, 67, 107, 73, 89, 103, 137
Offset: 1

Views

Author

Alois P. Heinz, Mar 20 2023

Keywords

Examples

			Square array A(n,k) begins:
    3,   3,   3,   3,   5,   3,   3,   7,  11,   7, ...
    5,   7,   5,   7,  11,   7,  11,  13,  29,  37, ...
   11,  13,  11,  13,  29,  19,  23,  37,  59,  67, ...
   17,  19,  23,  31,  41,  37,  29,  61,  89,  73, ...
   29,  37,  29,  37,  47,  43,  53,  97, 101,  79, ...
   41,  43,  53,  43,  71,  67,  71, 103, 107, 127, ...
   59,  67,  59,  67, 107,  73,  83, 127, 131, 139, ...
   71,  79,  71,  73, 131, 103, 101, 163, 149, 157, ...
  101,  97,  89,  97, 149, 109, 113, 193, 179, 163, ...
  107, 103, 101, 151, 167, 127, 149, 211, 197, 193, ...
		

Crossrefs

Row n=1 gives A056206.
Main diagonal gives A361680.
Cf. A000040.

Programs

  • Maple
    A:= proc() option remember; local f; f:= proc() [] end;
          proc(n, k) option remember; local p;
            p:= `if`(nops(f(k))=0, 1, f(k)[-1]);
            while nops(f(k))
    				

A127003 Smallest prime p such that p+10^n is also prime.

Original entry on oeis.org

2, 3, 3, 13, 7, 3, 3, 19, 7, 7, 19, 3, 61, 37, 31, 37, 61, 3, 3, 97, 151, 193, 139, 157, 7, 13, 67, 103, 331, 379, 211, 271, 709, 61, 193, 103, 67, 43, 547, 3, 139, 109, 991, 79, 31, 439, 937, 193, 193, 2089, 151, 457, 919, 223, 31, 157, 3, 607, 601, 19, 7, 379, 991, 307
Offset: 0

Views

Author

Rick L. Shepherd, Jan 01 2007

Keywords

Examples

			a(3)=13 because 13 is the smallest prime p such that p+10^3 (=1013) is also prime: For the primes < 13, 1002=2*3*167, 1003=17*59, 1005=3*5*67, 1007=19*53 and 1011=3*337, respectively, are not prime.
		

Crossrefs

Programs

  • Mathematica
    s={};Do[p=0;Until[PrimeQ[Prime[p]+10^n],p++];AppendTo[s,Prime[p]],{n,0,63}];s (* James C. McMahon, Dec 29 2024 *)

A057674 Primes -p+2^n with smallest p prime, arising in A057674.

Original entry on oeis.org

-3, 2, 5, 13, 29, 61, 109, 251, 509, 1021, 2029, 4093, 8179, 16381, 32749, 65519, 131059, 262139, 524269, 1048573, 2097133, 4194301, 8388571, 16777213, 33554371, 67108859, 134217649, 268435367, 536870909, 1073741783, 2147483629, 4294967291, 8589934513, 17179869143
Offset: 0

Views

Author

Labos Elemer, Oct 19 2000

Keywords

Examples

			n=1, 2^1=2. If 2,3,5 are subtracted from 2, then 0,-1 and -3 arise, of which -3 is a prime so a(1)=-3. n=11, 2048-p=q. At first p=29 gives the prime q=2029.
		

Crossrefs

A057676 Smallest prime q such that 2^prime(n) - q is prime.

Original entry on oeis.org

2, 3, 3, 19, 19, 13, 13, 19, 37, 3, 19, 31, 31, 67, 127, 379, 607, 31, 19, 577, 181, 67, 97, 31, 349, 619, 97, 919, 31, 211, 577, 181, 13, 397, 31, 829, 19, 577, 577, 103, 1669, 199, 19, 31, 439, 1021, 601, 1621, 2017, 733, 3, 199, 2113, 619, 1861, 1297, 241, 967
Offset: 1

Views

Author

Labos Elemer, Oct 19 2000

Keywords

Examples

			For n = 4, prime(4) = 11, 2^11 = 2048, p2 = 2048-p1 is satisfied at first with prime p1 = 19 resulting in prime p2 = 2029, so a(4) = 19.
For n = 31, prime(31) = 127, p2 = 2^127-p1 is satisfied first with p1 = 577 and p2 = 170141183460469231731687303715884105151, so a(31) = 577.
		

Crossrefs

Programs

  • Mathematica
    spq[n_]:=Module[{p=2,t=2^Prime[n]},While[!PrimeQ[t-p],p=NextPrime[p]];p]; Array[spq,60] (* Harvey P. Dale, Jul 13 2025 *)
  • PARI
    a(n) = {my(p = 1 << prime(n), q = 2); while(!isprime(p - q), q = nextprime(q + 1)); q;} \\ Amiram Eldar, Feb 18 2025

Extensions

Offset corrected by Amiram Eldar, Feb 18 2025

A371065 a(1)=2; for n > 1, a(n) is the least prime number p > a(n-1) such that p + 2^(n-1) is a prime number.

Original entry on oeis.org

2, 3, 7, 11, 13, 29, 37, 53, 61, 89, 127, 131, 157, 197, 223, 269, 307, 359, 367, 419, 463, 491, 547, 593, 607, 641, 643, 701, 823, 947, 1213, 1229, 1237, 1319, 1327, 1451, 1723, 2381, 3019, 3299, 3307, 3371, 3847, 4493, 4621, 4931, 5179, 5783, 6043, 6197, 6469
Offset: 1

Views

Author

Ahmad J. Masad, Mar 09 2024

Keywords

Examples

			For n=5, the preceding term a(4)=11 and 2^(5-1)=16, so a(5) is the least prime p > 11 such that p+16 is a prime too, which is p = 13 = a(5).
From _Michael De Vlieger_, Mar 10 2024: (Start)
Table of first terms:
   n   a(n)  2^(n+1)  a(n)+2^(n+1)
  -------------------------------
   1      2       1         3
   2      3       2         5
   3      7       4        11
   4     11       8        19
   5     13      16        29
   6     29      32        61
   7     37      64       101
   8     53     128       181
   9     61     256       317
  10     89     512       601
  11    127    1024      1151
  12    131    2048      2179
  ... (End)
		

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[n_] := a[n] = Module[{p = NextPrime[a[n - 1]]}, While[! PrimeQ[p + 2^(n - 1)], p = NextPrime[p]]; p]; Array[a, 50] (* Amiram Eldar, Mar 10 2024 *)
Showing 1-10 of 13 results. Next