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

A046132 Larger member p+4 of cousin primes (p, p+4).

Original entry on oeis.org

7, 11, 17, 23, 41, 47, 71, 83, 101, 107, 113, 131, 167, 197, 227, 233, 281, 311, 317, 353, 383, 401, 443, 461, 467, 491, 503, 617, 647, 677, 743, 761, 773, 827, 857, 863, 881, 887, 911, 941, 971, 1013, 1091, 1097, 1217, 1283, 1301, 1307, 1427, 1433
Offset: 1

Views

Author

Keywords

Comments

A pair of cousin primes are primes of the form p and p+4 (where p+2 may or may not be a prime). - N. J. A. Sloane, Mar 18 2021

Crossrefs

Essentially the same as A031505. Cf. A023200, A029710, A098429.

Programs

  • Haskell
    a046132 n = a046132_list !! (n-1)
    a046132_list = filter ((== 1) . a010051') $ map (+ 4) a000040_list
    -- Reinhard Zumkeller, Aug 01 2014
  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[p4=p+4], (*Print[p4];*)AppendTo[lst, p4]], {n, 10^2}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 21 2008 *)
    Select[Prime[Range[300]],PrimeQ[#+4]&]+4 (* Harvey P. Dale, Dec 15 2017 *)
  • PARI
    forprime(p=2,1e5,if(isprime(p-4),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    

Formula

a(n) = A023200(n) + 4 = A087679(n) + 2.
a(n) = 3*A157834(n-1) + 2 = A029710(n-1) + 4 = 6*A056956(n-1) + 5 (thus a(n) mod 6 == 5), for all n>1. - M. F. Hasler, Jan 15 2013

A029710 Primes such that next prime is 4 greater.

Original entry on oeis.org

7, 13, 19, 37, 43, 67, 79, 97, 103, 109, 127, 163, 193, 223, 229, 277, 307, 313, 349, 379, 397, 439, 457, 463, 487, 499, 613, 643, 673, 739, 757, 769, 823, 853, 859, 877, 883, 907, 937, 967, 1009, 1087, 1093, 1213, 1279, 1297, 1303, 1423, 1429
Offset: 1

Views

Author

Keywords

Comments

Union with A124588 gives A124589. - Reinhard Zumkeller, Dec 23 2006
For any prime p > 3, if p + 4 is prime then necessarily it is the next prime. But there cannot be three consecutive primes with mutual distance 4: If p and p + 4 are prime, then p+8 is an odd multiple of 3 (cf. formula). - M. F. Hasler, Jan 15 2013
The smaller members p of cousin prime pairs (p,p+4) excluding p=3. - Marc Morgenegg, Apr 19 2016

Examples

			79 is a term as the next prime is 79 + 4 = 83. 3 is not a term even though 3 + 4 = 7 is prime, since it is not the next one.
		

Crossrefs

Essentially the same as A023200.

Programs

  • MATLAB
    p=primes(1700);m=1;
    for u=1:length(p)-4
       if and(isprime(p(u)+4)==1,p(u+1)==p(u)+4);sol(m)=p(u);m=m+1;end
    end
    sol % Marius A. Burtea, Jan 24 2019
  • Magma
    [p:p in PrimesUpTo(1700)| IsPrime(p+4) and NextPrime(p) eq p+4] // Marius A. Burtea, Jan 24 2019
    
  • Maple
    for i from 1 to 226 do if ithprime(i+1) = ithprime(i) + 4 then print({ithprime(i)}); fi; od; # Zerinvary Lajos, Mar 19 2007
  • Mathematica
    Select[Prime[Range[225]], NextPrime[#] == # + 4 &] (* Alonso del Arte, Jan 17 2013 *)
    Transpose[Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==4&]] [[1]] (* Harvey P. Dale, Mar 28 2016 *)
  • PARI
    forprime(p=1, 1e4, if(nextprime(p+1)-p==4, print1(p, ", "))) \\ Felix Fröhlich, Aug 16 2014
    

Formula

a(n) = A031505(n + 1) - 4 = A029708(n) - 2.
a(n) = 1 (mod 6) for all n; (a(n) + 2)/3 = A157834(n), i.e., a(n) = 3*A157834(n) - 2. - M. F. Hasler, Jan 15 2013

A087679 Numbers k such that both k+2 and k-2 are prime.

Original entry on oeis.org

5, 9, 15, 21, 39, 45, 69, 81, 99, 105, 111, 129, 165, 195, 225, 231, 279, 309, 315, 351, 381, 399, 441, 459, 465, 489, 501, 615, 645, 675, 741, 759, 771, 825, 855, 861, 879, 885, 909, 939, 969, 1011, 1089, 1095, 1215, 1281, 1299, 1305, 1425, 1431, 1449, 1485
Offset: 1

Views

Author

Zak Seidov, Sep 27 2003

Keywords

Comments

Essentially the same as A029708: a(n) = A029708(n-1) for n>=2.
Midpoint of cousin prime pairs.
The only prime is 5. All other terms are multiples of 3. - Zak Seidov, May 19 2014

Crossrefs

Programs

  • Maple
    ZL:=[]:for p from 1 to 1485 do if (isprime(p) and isprime(p+4) ) then ZL:=[op(ZL),(p+(p+4))/2]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
  • Mathematica
    lst={};Do[If[PrimeQ[n-2]&&PrimeQ[n+2],AppendTo[lst,n]],{n,3,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 14 2009 *)
  • PARI
    s=[]; for(n=1, 2000, if(isprime(n-2) && isprime(n+2), s=concat(s, n))); s \\ Colin Barker, May 19 2014
    
  • PARI
    is_A087679(n)={isprime(n-2) && isprime(n+2)} \\ For numbers >> 10^12 one should add conditions {n%6==3 && ... || n==5} or consider only such numbers congruent to 3 (mod 6). - M. F. Hasler, Apr 05 2017

Formula

a(n) = (A023200(n) + A046132(n))/2 = A023200(n) + 2 = A046132(n) - 2.
a(n+1) = A056956(n)*6 + 3 = A157834(n)*3; a(n) = A088762(n)*2 + 1. - M. F. Hasler, Apr 05 2017

Extensions

More terms from Ray Chandler, Oct 26 2003

A268475 Numbers n such that n^3 +/- 2 and 3*n +/- 2 are all prime.

Original entry on oeis.org

435, 555, 2415, 31635, 38025, 44835, 80625, 88335, 97455, 98505, 99435, 124335, 142065, 145095, 165375, 176055, 204765, 246435, 279225, 293475, 310095, 315555, 332085, 344745, 348735, 376935, 392415, 443595, 462105, 467385, 482355, 581415, 609555, 626775, 636015
Offset: 1

Views

Author

K. D. Bajpai, Feb 05 2016

Keywords

Comments

All the terms in this sequence are congruent to 0 (mod 5).
Each term in this sequence yields two sets of cousin prime pairs i.e., for n = 435 -> {82312877, 82312873} and {1307, 1303}.
All terms are congruent to 15 mod 30. - Robert Israel, Feb 05 2016

Examples

			435 is in the sequence because 435^3 + - 2 =  82312877, 82312873; 3*435 + - 2 = 1307, 1303 are all prime.
555 is in the sequence because 555^3 + - 2 =  170953877, 170953873; 3*555 + - 2 = 1667, 1663 are all prime.
		

Crossrefs

Programs

  • Magma
    [n : n in [1..1e5] | IsPrime(n^3 + 2) and IsPrime(n^3 - 2) and IsPrime(3*n + 2) and IsPrime(3*n - 2)];
  • Maple
    select(n -> andmap(isprime, [n^3 + 2, n^3 - 2, 3*n + 2, 3*n - 2]), [seq(p, p=1.. 10^6)]);
  • Mathematica
    Select[Range[1000000], PrimeQ[#^3 + 2] && PrimeQ[#^3 - 2] && PrimeQ[3 # + 2] && PrimeQ[3 # - 2] &]
  • PARI
    for(n = 1,1e5, if( isprime(n^3 + 2) && isprime(n^3 - 2) && isprime(3*n + 2) && isprime(3*n - 2), print1(n ", ")))
    

A233348 Numbers n such that 3*n+2 and 3*n-2 are both prime for n multiple of 5 (A008587).

Original entry on oeis.org

5, 15, 35, 55, 65, 75, 105, 155, 205, 215, 225, 275, 285, 295, 365, 405, 435, 475, 495, 555, 565, 595, 625, 665, 695, 735, 765, 825, 895, 945, 985, 1055, 1085, 1115, 1155, 1205, 1225, 1265, 1315, 1335, 1385, 1505, 1595, 1605, 1645, 1745, 1805, 1835, 1885
Offset: 1

Views

Author

César Aguilera, Dec 07 2013

Keywords

Examples

			For n=15; 3*15+2=47 and 3*15-2=43.
		

Crossrefs

Cf. A157834 (n such that 3n-2 and 3n+2 are both prime).

Programs

  • Mathematica
    Select[5*Range[500], PrimeQ[3 # + 2] && PrimeQ[3 # - 2] &] (* T. D. Noe, Dec 09 2013 *)

Formula

Intersection of A008587 and A157834.
Showing 1-5 of 5 results.