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.

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