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.

A155882 Smallest positive prime number such that a(n)-2n is also prime, a(n) < a(n+1), and the differences a(n)-2n must increase with n.

Original entry on oeis.org

5, 11, 17, 31, 41, 53, 61, 83, 89, 103, 131, 137, 157, 167, 179, 199, 227, 233, 271, 281, 293, 307, 317, 331, 367, 383, 401, 409, 431, 439, 463, 503, 509, 547, 557, 563, 577, 599, 619, 643, 653, 661, 673, 701, 709, 733, 821, 829, 859, 887, 911, 967, 983, 991
Offset: 1

Views

Author

Eric Angelini, Jan 29 2009

Keywords

Comments

Subtracting from a(1) twice n=1 gives 5-2=3, which is a prime number; subtracting from a(2) twice n=2 gives 11-4=7, which is a prime number; subtracting from a(3) twice n=3 gives 17-6=11, which is a prime number; subtracting from a(4) twice n=4 gives 31-8=23, which is a prime number; etc.

Crossrefs

Cf. A020484, A108184 (for the differences a(n)-2n).

Programs

  • Maple
    b:= proc(n) option remember; global a; a(n); b(n) end: a:= proc(n) option remember; local m; global b; if n=1 then b(1):= 3; 5 else for m from a(n-1)+2 by 2 while not (isprime(m) and (b(n-1)Alois P. Heinz, Feb 05 2009

Extensions

Corrected definition and more terms from Alois P. Heinz, Feb 05 2009

A237057 a(n) = smallest prime > a(n-1) such that a(n)+4n is also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 31, 41, 43, 61, 83, 89, 97, 101, 103, 109, 113, 127, 151, 191, 193, 223, 239, 241, 283, 293, 311, 331, 347, 359, 367, 419, 431, 433, 461, 463, 499, 509, 521, 523, 563, 571, 601, 647, 659, 673, 719, 727, 733, 797, 809, 811, 821, 823, 829
Offset: 0

Views

Author

Carmine Suriano, Feb 03 2014

Keywords

Comments

Many twin primes belong to the sequence, for example (41, 43) and (191, 193).
Many consecutive primes also appear such as (13, 17) and (83, 89).

Examples

			a(5)=17 since 17+4*5=17+20=37 is prime. 11+4*4=27 is not prime, so 11 is not in the sequence.
		

Crossrefs

Cf. A108184.

Programs

  • Mathematica
    nxt[{n_,p_}]:=Module[{np=NextPrime[p]},While[!PrimeQ[np+4(n+1)],np = NextPrime[ np]];{n+1,np}]; Transpose[NestList[nxt,{0,2},60]][[2]] (* Harvey P. Dale, Feb 26 2015 *)
  • PARI
    a237057(maxp) = {my(a=[2], n=1); forprime(p=3, maxp, if(isprime(p+4*n), n++; a=concat(a, p)));  a} \\ Colin Barker, Feb 12 2014

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