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.

A342564 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.

This page as a plain text file.
%I A342564 #26 Sep 05 2021 17:25:16
%S A342564 6,13,37,73,793,3750,5400,8893,9600,10082,12150,12973,15913,16537,
%T A342564 26533,27335,29400,32413,39853,54150,63037,69337,82835,113437,126142,
%U A342564 134085,185852,277350,290400,370513,432553,478837,531037,585937,667333,768980,837013,889350
%N A342564 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.
%F A342564 a(n) = (A048880(n+1) - 1)/6, excluding A048880(1).
%e A342564 a(1) = 6 because 6*6 + 1 = 37 can be written as 5*7 + 2.
%p A342564 alist := proc(upto) local L, q, p, n, r; L := []; q := 2;
%p A342564 for n from 1 to upto do
%p A342564     p := q; q := nextprime(p); r := p * q + 1 ;
%p A342564     if modp(r, 6) = 0 and isprime(r + 1) then
%p A342564        L := [op(L), iquo(r, 6)] fi od;
%p A342564 L end: alist(350); # _Peter Luschny_, Jun 20 2021
%t A342564 (Select[6Range[10^6]+1, PrimeQ[#] && MatchQ[FactorInteger[#-2], {{p_, 1}, {q_, 1}} /; q == NextPrime[p]]&]-1)/6 (* _Jean-François Alcover_, Jul 07 2021 *)
%o A342564 (PARI) a342564(plim)={my(p1=5);forprime(p2=7,plim,my(p=p1*p2+2);if(isprime(p),print1((p-1)/6,", "));p1=p2)};
%o A342564 a342564(2400)
%o A342564 (Python)
%o A342564 from primesieve.numpy import n_primes
%o A342564 from numbthy import isprime
%o A342564 primesarray = numpy.array(n_primes(10000,1))
%o A342564 for i in range (0, 9999):
%o A342564     totest = int(primesarray[i] * primesarray[i+1] + 2)
%o A342564     if (isprime(totest)) and  (((totest-1)%6) == 0):
%o A342564         print((totest-1)//6) # _Karl-Heinz Hofmann_, Jun 20 2021
%Y A342564 Cf. A048880, whose first term 17 = 3*5 + 2 cannot be written as 6*k + 1.
%Y A342564 Cf. A123921, A342565.
%K A342564 nonn,easy
%O A342564 1,1
%A A342564 _Hugo Pfoertner_, Jun 20 2021