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

A248483 Consider two consecutive primes {p,q} such that P=2p+q and Q=2q+p are both prime. The sequence gives primes Q.

Original entry on oeis.org

13, 19, 47, 181, 317, 367, 677, 743, 811, 1031, 1489, 2347, 2381, 2477, 2749, 2777, 4729, 4951, 5189, 5657, 5851, 6287, 7297, 7583, 8287, 8867, 8969, 9001, 9049, 9463, 10103, 10733, 11261, 12713, 13109, 14009, 14747, 17393, 17749, 18679, 19081, 20399, 21157, 22541
Offset: 1

Views

Author

Zak Seidov, Oct 07 2014

Keywords

Examples

			a(1)=13 because p=3, q=5 and P=11 and Q=13 are both prime.
a(3)=47 because p=13, q=17 and P=43 and Q=47 are both prime.
		

Crossrefs

Cf. A181848 (primes p), A248480 (primes q), A248482 (primes P).

Programs

  • Maple
    R:= NULL: count:= 0:
    q:= 2:
    while count < 100 do
      p:= q; q:= nextprime(q);
      if isprime(2*p+q) and isprime(p+2*q) then
        count:= count+1; R:= R, p+2*q
      fi
    od:
    R; # Robert Israel, Jan 05 2021
  • Mathematica
    Select[Table[If[PrimeQ[2*Prime[j-1] + Prime[j]] && PrimeQ[Prime[j-1] + 2*Prime[j]],Prime[j-1] + 2*Prime[j],0],{j,2,2000}],#!=0&] (* Vaclav Kotesovec, Oct 08 2014 *)
    2#[[2]]+#[[1]]&/@Select[Partition[Prime[Range[1000]],2,1],AllTrue[{2#[[1]]+#[[2]],2#[[2]]+ #[[1]]},PrimeQ]&]  (* Harvey P. Dale, Jan 10 2024 *)
  • PARI
    listQ(nn) = {forprime(p=2, nn, q = nextprime(p+1); if (isprime(2*p+q) && isprime(Q=2*q+p), print1(Q, ", ")););} \\ Michel Marcus, Oct 07 2014

A248482 Consider two consecutive primes {p,q} such that P=2p+q and Q=2q+p are both prime. The sequence gives primes P.

Original entry on oeis.org

11, 17, 43, 179, 313, 353, 673, 733, 809, 1021, 1481, 2333, 2371, 2473, 2741, 2767, 4721, 4931, 5179, 5647, 5849, 6277, 7283, 7573, 8273, 8863, 8941, 8999, 9041, 9437, 10093, 10723, 11239, 12703, 13099, 13999, 14737, 17383, 17729, 18671, 19079, 20389, 21143, 22531
Offset: 1

Views

Author

Zak Seidov, Oct 07 2014

Keywords

Examples

			a(1)=11 because p=3, q=5 and P=11 and Q=13 are both prime.
a(3)=43 because p=13, q=17 and P=43 and Q=47 are both prime.
		

Crossrefs

Cf. A181848(primes p), A248480(primes q), A248483(primes Q).

Programs

  • Mathematica
    Select[Table[If[PrimeQ[2*Prime[j-1] + Prime[j]] && PrimeQ[Prime[j-1] + 2*Prime[j]],2*Prime[j-1] + Prime[j],0],{j,2,2000}],#!=0&] (* Vaclav Kotesovec, Oct 08 2014 *)
    2#[[1]]+#[[2]]&/@Select[Partition[Prime[Range[1000]],2,1],AllTrue[ {2#[[1]]+ #[[2]],2#[[2]]+#[[1]]},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 28 2017 *)
  • PARI
    listP(nn) = {forprime(p=2, nn, q = nextprime(p+1); if (isprime(P=2*p+q) && isprime(2*q+p), print1(P, ", ")););} \\ Michel Marcus, Oct 07 2014
Showing 1-2 of 2 results.