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

A023200 Primes p such that p + 4 is also prime.

Original entry on oeis.org

3, 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, 1447, 1483
Offset: 1

Views

Author

Keywords

Comments

Smaller member p of cousin prime pairs (p, p+4).
A015913 contains the composite number 305635357, so it is different from both the present sequence and A029710. (305635357 is the only composite member of A015913 < 10^9.) - Jud McCranie, Jan 07 2001
Apart from the first term, all terms are of the form 6n + 1.
Complement of A067775 (primes p such that p + 4 is composite) with respect to A000040 (primes). With prime 2 also primes p such that q^2 + p is prime for some prime q (q = 3 if p = 2, q = 2 if p > 2). Subsequence of A232012. - Jaroslav Krizek, Nov 23 2013
Conjecture: The sequence is infinite and for every n, a(n+1) < a(n)^(1+1/n). Namely a(n)^(1/n) is a strictly decreasing function of n. - Jahangeer Kholdi and Farideh Firoozbakht, Nov 24 2014
From Alonso del Arte, Jan 12 2019: (Start)
If p splits in Z[sqrt(-2)], p + 4 is an inert prime in that domain. Likewise, if p splits in Z[sqrt(2)], p + 4 is an inert prime in that domain.
The only way for p or p + 4 to split in both domains is if it is congruent to 1 modulo 24, in which case the other prime is inert in both domains.
For example, 3 = (1 - sqrt(-2))*(1 + sqrt(-2)) but is inert in Z[sqrt(2)], while 7 = (3 - sqrt(2))*(3 + sqrt(2)) but is inert in Z[sqrt(-2)]. And also 11 = (3 - sqrt(-2))*(3 + sqrt(-2)) but 15 is composite in Z or any quadratic integer ring.
And 97 = (5 - 6*sqrt(-2))*(5 + 6*sqrt(-2)) = (1 - 7*sqrt(2))*(1 + 7*sqrt(2)), but 101 is inert in both Z[sqrt(-2)] and Z[sqrt(2)]. (End)

Crossrefs

Exactly the same as A029710 except for the exclusion of 3.

Programs

  • Haskell
    a023200 n = a023200_list !! (n-1)
    a023200_list = filter ((== 1) . a010051') $
                   map (subtract 4) $ drop 2 a000040_list
    -- Reinhard Zumkeller, Aug 01 2014
  • Magma
    [p: p in PrimesUpTo(1500) | NextPrime(p)-p eq 4]; // Bruno Berselli, Apr 09 2013
    
  • Maple
    A023200 := proc(n) option remember; if n = 1 then 3; else p := nextprime(procname(n-1)) ; while not isprime(p+4) do p := nextprime(p) ;  end do: p ; end if; end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    Select[Range[10^2], PrimeQ[#] && PrimeQ[# + 4] &] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    Select[Prime[Range[250]],PrimeQ[#+4]&] (* Harvey P. Dale, Oct 09 2023 *)
  • PARI
    print1(3);p=7;forprime(q=11,1e3,if(q-p==4,print1(", "p)); p=q) \\ Charles R Greathouse IV, Mar 20 2013
    

Formula

a(n) = A046132(n) - 4 = A087679(n) - 2.
a(n) >> n log^2 n via the Selberg sieve. - Charles R Greathouse IV, Nov 20 2016

Extensions

Definition modified by Vincenzo Librandi, Aug 02 2009
Definition revised by N. J. A. Sloane, Mar 05 2010

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

A098428 Number of sexy prime pairs (p, p+6) with p <= n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 07 2004

Keywords

Comments

Since there are 2 congruence classes of sexy prime pairs, (-1, -1) (mod 6) and (+1, +1) (mod 6), the number of sexy prime pairs up to n is the sum of the number of sexy prime pairs for each class, expected to be asymptotically the same for both (with the expected Chebyshev bias against the quadratic residue class (+1, +1) (mod 6), which doesn't affect the asymptotic distribution among the 2 classes). - Daniel Forgues, Aug 05 2009

Examples

			The first sexy prime pairs are: (5,11), (7,13), (11,17), (13,19), ...
therefore the sequence starts: 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 4, ...
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[PrimeQ[n]&&PrimeQ[n+6],1,0],{n,100}]] (* Harvey P. Dale, Feb 08 2015 *)
  • PARI
    apply( {A098428(n,o=2,q=o,c)=forprime(p=1+q, n+6, (o+6==p)+((o=q)+6==q=p) && c++);c}, [1..99]) \\ M. F. Hasler, Jan 02 2020
    [#[p:p in PrimesInInterval(1,n)| IsPrime(p+6)]:n in [1..100]]; // Marius A. Burtea, Jan 03 2020

Formula

a(n) = # { p in A023201 | p <= n } = number of elements in intersection of A023201 and [1,n]. - M. F. Hasler, Jan 02 2020

Extensions

Edited by Daniel Forgues, Aug 01 2009, M. F. Hasler, Jan 02 2020
Showing 1-3 of 3 results.