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.

A329941 Least prime, p, such that 2*p*3^n - 1 and 2*p*3^n + 1 are twin primes.

Original entry on oeis.org

2, 11, 2, 5, 43, 29, 53, 311, 113, 109, 367, 859, 647, 11, 2, 619, 13, 1051, 157, 2801, 3767, 5, 337, 1721, 3517, 41, 4013, 1879, 1873, 13649, 4637, 2909, 8387, 6521, 1453, 6599, 1277, 4801, 167, 1031, 11213, 4129, 4933, 199, 1427, 859, 9227, 5581, 863, 11959, 10453
Offset: 1

Views

Author

Pierre CAMI, Nov 24 2019

Keywords

Examples

			2*2*3^1 - 1 = 11; 11 and 13 are twin primes so a(1)=2.
2*11*3^2 - 1 = 197; 197 and 199 are twin primes so a(2)=11 as no other prime p < 11 gives twin primes.
		

Crossrefs

Cf. A130327.

Programs

  • Mathematica
    Array[Block[{p = 2}, While[! AllTrue[2 p 3^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 51] (* Michael De Vlieger, Dec 24 2019 *)
  • PARI
    a(n) = {my(p=2); while (!isprime(2*p*3^n - 1) || !isprime(2*p*3^n + 1), p = nextprime(p+1)); p;} \\ Michel Marcus, Nov 25 2019