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

A174915 Numbers p such that p, q=p+2 and p+2*q are all primes.

Original entry on oeis.org

3, 5, 11, 41, 59, 101, 179, 191, 269, 311, 431, 521, 599, 821, 881, 1019, 1061, 1151, 1229, 1301, 1451, 1481, 1619, 1721, 1949, 2081, 2111, 2141, 2729, 2999, 3299, 3821, 4001, 4091, 4259, 4421, 4799, 4931, 5009, 5519, 5639, 5849, 6131, 6359, 6689, 6701
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A175914.

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(7000) | IsPrime(p+2) and IsPrime(3*p+4)]; // Vincenzo Librandi, Jan 29 2015
  • Mathematica
    lst={};Do[p1=Prime[n];p2=p1+2;If[PrimeQ[p2]&&PrimeQ[p1+2*p2],AppendTo[lst,p1]],{n,7!}];lst
    Reap[Do[p = Prime[m]; If[PrimeQ[p + 2 ] && PrimeQ[3 p + 4], Sow[p]], {m, 10^3}]][[2, 1]](* Zak Seidov, Oct 14 2012 *)
    Transpose[Select[Partition[Prime[Range[1000]],2,1],#[[2]]-#[[1]]==2 && PrimeQ[ #[[1]]+2#[[2]]]&]][[1]] (* Harvey P. Dale, Jan 28 2015 *)
  • PARI
    forprime(p=2,7000,q=p+2;if(isprime(q)&& isprime(p+2*q),print1(p,", ")))
    

Extensions

Definition and comment corrected by Zak Seidov, Dec 06 2010

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

Original entry on oeis.org

3, 5, 13, 59, 103, 113, 223, 241, 269, 337, 491, 773, 787, 823, 911, 919, 1571, 1637, 1723, 1879, 1949, 2089, 2423, 2521, 2753, 2953, 2971, 2999, 3011, 3137, 3361, 3571, 3739, 4231, 4363, 4663, 4909, 5791, 5903, 6221, 6359, 6793, 7043, 7507, 7873, 9323, 9403
Offset: 1

Views

Author

Zak Seidov, Aug 18 2012

Keywords

Comments

Note that Q-P=q-p and {P,Q} are not necessarily consecutive primes.

Examples

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

Crossrefs

Intersection of A173971 and A175914. - Zak Seidov, Mar 04 2016

Programs

  • Mathematica
    a=2;Reap[Do[b=Prime[n];If[PrimeQ[2*a+b]&&PrimeQ[2*b+a],Sow[a]];a=b,{n,2,200}]][[2,1]]
    Select[Partition[Prime[Range[1200]],2,1],AllTrue[{2 #[[1]]+#[[2]],2 #[[2]]+#[[1]]},PrimeQ]&][[;;,1]] (* Harvey P. Dale, Mar 24 2025 *)
  • PARI
    isok(p) = isprime(p) && (q=nextprime(p+1)) && isprime(p+2*q) && isprime(q+2*p); \\ Michel Marcus, Mar 05 2016

A337213 Primes prime(k) such that prime(k) + 2*prime(k+1) and prime(k) + 2*prime(k+1) + 4*prime(k+2) are prime.

Original entry on oeis.org

3, 43, 59, 127, 599, 673, 937, 1451, 1619, 1847, 2089, 2311, 2953, 3343, 3613, 3677, 4817, 4909, 4973, 5519, 5639, 5857, 6359, 6389, 7043, 7069, 7537, 8867, 9157, 9341, 10039, 11069, 12301, 12907, 13327, 13729, 14293, 14549, 15619, 15739, 15877, 17077, 17351, 17977, 18253, 19211, 19387, 19469
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 19 2020

Keywords

Examples

			a(3)=59 is in the sequence because 59, 61, 67 are consecutive primes and 59+2*61=181 and 59+2*61+4*67=449 are prime.
		

Crossrefs

Programs

  • Maple
    N:= 2000: # to get terms in the first N primes
    P:= [seq(ithprime(i),i=1..N+2)]:
    P[select(i -> isprime(P[i]+2*P[i+1]) and isprime(P[i]+2*P[i+1]+4*P[i+2]), [$1..N])];

A337214 Primes prime(k) such that prime(k) + 2*prime(k+1), prime(k) + 2*prime(k+1) + 4*prime(k+2) and prime(k) + 2*prime(k+1) + 4*prime(k+2) + 8*prime(k+3) are all prime.

Original entry on oeis.org

43, 599, 1451, 8867, 18253, 19211, 19469, 27329, 29863, 40787, 41141, 75403, 85991, 104707, 119921, 131009, 137383, 150551, 167309, 173263, 195977, 201247, 222863, 277961, 285199, 350429, 364333, 374461, 382747, 385783, 406499, 419743, 423803, 466673, 496289, 512821, 532241, 541529, 541579
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 19 2020

Keywords

Examples

			a(3)=1451 is in the sequence because 1451, 1453, 1459, 1471 are consecutive primes and 1451+2*1453=4357, 1451+2*1453+4*1459=10193, and 1451+2*1453+4*1459+8*1471=21961 are all prime.
		

Crossrefs

Programs

  • Maple
    N:= 60000: # to get terms in the first N primes
    P:= [seq(ithprime(i), i=1..N+3)]:
    P[select(i -> isprime(P[i]+2*P[i+1]) and isprime(P[i]+2*P[i+1]+4*P[i+2]) and isprime(P[i]+2*P[i+1]+4*P[i+2]+8*P[i+3]) , [$1..N])];

A368691 Primes p such that p + 4 * q is prime, where q is the next prime after p.

Original entry on oeis.org

3, 23, 31, 73, 83, 157, 167, 211, 251, 353, 373, 443, 467, 503, 509, 523, 541, 571, 647, 727, 751, 941, 947, 977, 1033, 1069, 1123, 1201, 1259, 1361, 1381, 1493, 1511, 1531, 1553, 1613, 1759, 1811, 2011, 2207, 2333, 2351, 2383, 2399, 2417, 2543, 2777, 2927, 3061, 3067, 3083, 3301, 3331, 3511
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Jan 03 2024

Keywords

Examples

			a(3) = 31 is a term because 31 is prime, the next prime is 37, and 31 + 4 * 37 = 179 is prime.
		

Crossrefs

Cf. A175914.

Programs

  • Maple
    filter:= proc(p) local q;
      if not isprime(p) then return false fi;
      q:= nextprime(p);
      isprime(p+4*q)
    end proc:
    select(filter, [seq(i,i=3..10000,2)]);
  • Mathematica
    f[p_] := Module[{q}, If[!PrimeQ[p], Return[False]]; q = NextPrime[p]; PrimeQ[p + 4*q]];Select[Range[3,3511, 2],f] (* James C. McMahon, Jan 03 2024 *)

A381532 Smallest integer k>0 such that prime(n) + k*prime(n+1) is prime.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 6, 6, 4, 8, 4, 6, 2, 2, 10, 10, 2, 6, 12, 6, 4, 6, 4, 2, 14, 2, 2, 6, 6, 2, 2, 6, 6, 6, 20, 6, 4, 8, 4, 16, 2, 2, 2, 2, 8, 10, 4, 2, 6, 6, 6, 14, 2, 4, 10, 6, 2, 6, 2, 6, 18, 2, 2, 2, 2, 12, 10, 2, 6, 6, 4, 2, 22, 4, 6, 10, 12, 6, 8, 8, 12, 2
Offset: 1

Views

Author

Jean-Marc Rebert, Mar 07 2025

Keywords

Examples

			a(1)= 1, because 2 and 3 are consecutive primes and 2 + 1*3 = 5 is prime, and no lesser number has this property.
 p + k*q, where p and q are consecutive primes
 2 + 1* 3 =   5 is prime;
 3 + 2* 5 =  13 is prime;
 5 + 2* 7 =  19 is prime;
 7 + 2*11 =  29 is prime;
		

Crossrefs

Cf. A129919 (resulting primes), A175914 (primes for which k=2), A368691 (primes for which k=4).

Programs

  • Mathematica
    Do[k=0;Until[PrimeQ[Prime[n]+k*Prime[n+1]],k++];a[n]=k,{n,82}];Array[a,82] (* James C. McMahon, Mar 28 2025 *)
  • PARI
    a(n) = my(p=prime(n), q=nextprime(p+1), k=1); while (!isprime(p+k*q), k++); k; \\ Michel Marcus, Mar 09 2025
Showing 1-6 of 6 results.