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

A241945 Indices n where both prime(n) + 2*prime(n+1) and 2*prime(n) + prime(n+1) are primes.

Original entry on oeis.org

2, 3, 6, 17, 27, 30, 48, 53, 57, 68, 94, 137, 138, 143, 156, 157, 248, 259, 269, 289, 296, 316, 360, 369, 402, 425, 429, 430, 432, 446, 474, 500, 522, 580, 596, 631, 656, 760, 777, 810, 828, 875, 906, 951, 994, 1154, 1163, 1233, 1273, 1338, 1346, 1352, 1378, 1381, 1385, 1391, 1402, 1422, 1436, 1495, 1552, 1602
Offset: 1

Views

Author

Zak Seidov, May 03 2014

Keywords

Examples

			n=2 is in the sequence because 3 + 2*5 = 13 and 5 + 2*3 = 11 are primes.
n=3 is in the sequence because 5 + 2*7 = 19 and 7 + 2*5 = 17 are primes.
n=6 is in the sequence because 17 + 2*13 = 43 and 13 + 2*17 = 47 are primes.
		

Crossrefs

Cf. A094104 (primes of form 2*p + q), A094105 (primes of form p + 2*q).

Programs

  • PARI
    isok(n) = my(p=prime(n), q=nextprime(p+1)); isprime(p+2*q) && isprime(2*p+q); \\ Michel Marcus, Jan 06 2019

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

A186169 Consider two consecutive primes {p,q} such that {P=2p-q,Q=2q-p} are both prime. Sequence gives lesser primes p.

Original entry on oeis.org

47, 257, 607, 619, 647, 1097, 1459, 1499, 1709, 1747, 1889, 2677, 2861, 3307, 3559, 4007, 5107, 5387, 5419, 6317, 6367, 7309, 7829, 9467, 10079, 10639, 11789, 12589, 12647, 12721, 13457, 14747, 15149, 15749, 15797, 15889, 15907, 17477, 17839, 18217, 19477
Offset: 1

Views

Author

Zak Seidov, Aug 18 2012

Keywords

Comments

Note that Q-P=3(q-p).
No common terms with A181848.

Examples

			a(1)=47 because p=47, q=53 and {P=41,Q=59} are both prime.
		

Crossrefs

Cf. A181848.

Programs

  • Mathematica
    a = 2; Reap[ Do[b = Prime[n]; If[PrimeQ[2*a - b] && PrimeQ[2*b - a], Sow[a]]; a = b, {n, 2, 1000}]][[2, 1]]
    Transpose[Select[Partition[Prime[Range[2500]],2,1],AllTrue[{2#[[1]]- #[[2]], 2#[[2]]-#[[1]]},PrimeQ]&]][[1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 14 2015 *)

A215684 Let p=prime=a(n); then a(n+1) = smallest prime q>p such that 2p+q and 2q+p are both primes.

Original entry on oeis.org

3, 5, 7, 17, 67, 107, 277, 353, 487, 557, 787, 797, 853, 983, 1033, 1163, 1597, 1637, 1657, 1697, 1867, 1913, 2347, 2543, 2833, 2897, 2953, 2957, 3343, 3413, 3607, 3623, 3643, 3863, 3907, 4013, 4447, 4583, 4987, 5087, 5113, 5507, 6277, 6653, 7027, 7433, 7603
Offset: 1

Views

Author

Zak Seidov, Aug 20 2012

Keywords

Examples

			2*3+5=11 and 2*5+3=13 are both prime, so a(2) = 5.
2*7+17=31 and 2*17+7=41 are both prime, so a(4) = 17.
		

Crossrefs

Cf. A181848.

Programs

  • Mathematica
    a=3;s={a};m=100;Do[n1=PrimePi[a]+1;Do[b=Prime[n];If[PrimeQ[2*a+b]&&PrimeQ[2*b+a],AppendTo[s,b];a=b;Break[]],{n,n1,n1+100000}],{m-1}];s
    spq[n_]:=Module[{p=NextPrime[n]},While[!PrimeQ[2n+p]||!PrimeQ[2p+n],p=NextPrime[p]];p]; NestList[spq,3,50] (* Harvey P. Dale, Apr 06 2019 *)

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

Original entry on oeis.org

5, 7, 17, 61, 107, 127, 227, 251, 271, 347, 499, 787, 797, 827, 919, 929, 1579, 1657, 1733, 1889, 1951, 2099, 2437, 2531, 2767, 2957, 2999, 3001, 3019, 3163, 3371, 3581, 3761, 4241, 4373, 4673, 4919, 5801, 5923, 6229, 6361, 6803, 7057, 7517, 7877, 9337, 9413, 10061, 10399, 11057, 11117, 11171
Offset: 1

Views

Author

Zak Seidov, Oct 07 2014

Keywords

Examples

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

Crossrefs

Cf. A181848 (primes p), A248482 (primes P), A248483 (primes Q).

Programs

  • Mathematica
    Select[Table[If[PrimeQ[2*Prime[j-1] + Prime[j]] && PrimeQ[Prime[j-1] + 2*Prime[j]],Prime[j],0],{j,2,2000}],#!=0&] (* Vaclav Kotesovec, Oct 08 2014 *)
  • PARI
    listq(nn) = {forprime(p=2, nn, q = nextprime(p+1); if (isprime(2*p+q) && isprime(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

A352630 First of two consecutive primes p,q such that either p+2*q and (2*p+q)/5 or (p+2*q)/5 and 2*p+q are primes.

Original entry on oeis.org

7, 11, 17, 19, 101, 109, 227, 229, 277, 349, 521, 743, 769, 839, 937, 983, 1151, 1373, 1427, 1609, 1721, 1823, 2039, 2081, 2267, 2273, 2843, 3373, 3433, 3779, 3821, 3847, 3967, 4217, 4517, 4583, 5417, 5531, 5669, 5779, 6197, 6577, 6701, 6761, 6883, 7537, 7669, 7727, 8467, 8609, 8837, 9173, 9281
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 24 2022

Keywords

Examples

			a(3) = 17 is a term because it is prime, the next prime is 19, and (17+2*19)/5 = 11 and 2*17+19 = 53 are prime.
		

Crossrefs

Cf. A181848.

Programs

  • Maple
    R:= NULL: q:= 2:
    while q < 10000 do
      p:= q; q:= nextprime(p); s:= p+2*q; t:= 2*p+q;
      if (s mod 5 = 0 and isprime(s/5) and isprime(t)) or (t mod 5 = 0 and isprime(s) and isprime(t/5)) then R:= R,p;
      fi
    od:
    R;
Showing 1-7 of 7 results.