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.

A342565 Numbers k such that 6*k - 1 is a prime that can be written as p*q - 2, with p and q being consecutive primes.

Original entry on oeis.org

4265, 7842, 11265, 22815, 52265, 160065, 167662, 322003, 383542, 393722, 1016815, 1051677, 1150182, 1290842, 1372803, 1555498, 1826015, 2184065, 2808498, 3168265, 3200307, 3231062, 3333117, 3427680, 3676962, 3913915, 4042598, 4323102, 4537907, 4623542, 4798955
Offset: 1

Views

Author

Hugo Pfoertner, Jun 20 2021

Keywords

Examples

			a(1) = 4265, because the prime 25589 = 6*4265 - 1 can be written as 157*163 - 2, with 157 and 163 being consecutive primes.
		

Crossrefs

Cf. A123921, whose first term 13 = 3*5 - 2 cannot be written as 6*k - 1.

Programs

  • PARI
    a342565(plim)={my(p1=5);forprime(p2=7,plim,my(p=p1*p2-2);if(isprime(p),print1((p+1)/6,", "));p1=p2)};
    a342565(5400)
    
  • Python
    from primesieve.numpy import n_primes
    from numbthy import isprime
    primesarray = numpy.array(n_primes(10000, 1))
    for i in range (0, 9999):
        totest = int(primesarray[i] * primesarray[i+1] - 2)
        if (isprime(totest)) and  (((totest+1)%6) == 0):
            print((totest+1)//6) # Karl-Heinz Hofmann, Jun 20 2021

Formula

a(n) = (A123921(n+1) + 1)/6, excluding A123921(1).