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.

A023201 Primes p such that p + 6 is also prime. (Lesser of a pair of sexy primes.)

Original entry on oeis.org

5, 7, 11, 13, 17, 23, 31, 37, 41, 47, 53, 61, 67, 73, 83, 97, 101, 103, 107, 131, 151, 157, 167, 173, 191, 193, 223, 227, 233, 251, 257, 263, 271, 277, 307, 311, 331, 347, 353, 367, 373, 383, 433, 443, 457, 461, 503, 541, 557, 563, 571, 587, 593, 601, 607, 613, 641, 647
Offset: 1

Views

Author

Keywords

Crossrefs

A031924 (primes starting a gap of 6) and A007529 together give this (A023201).
Cf. A046117 (a(n)+6), A087695 (a(n)+3), A098428, A000040, A010051, A006489 (subsequence).

Programs

  • Haskell
    a023201 n = a023201_list !! (n-1)
    a023201_list = filter ((== 1) . a010051 . (+ 6)) a000040_list
    -- Reinhard Zumkeller, Feb 25 2013
    
  • Magma
    [n: n in [0..40000] | IsPrime(n) and IsPrime(n+6)]; // Vincenzo Librandi, Aug 04 2010
    
  • Maple
    A023201 := proc(n)
        option remember;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+2 by 2 do
                if isprime(a) and isprime(a+6) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, May 28 2013
  • Mathematica
    Select[Range[10^2], PrimeQ[ # ]&&PrimeQ[ #+6] &] (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    Select[Prime[Range[120]],PrimeQ[#+6]&] (* Harvey P. Dale, Mar 20 2018 *)
  • PARI
    is(n)=isprime(n+6)&&isprime(n) \\ Charles R Greathouse IV, Mar 20 2013

Formula

From M. F. Hasler, Jan 02 2020: (Start)
a(n) = A046117(n) - 6 = A087695(n) - 3.
A023201 = { p = A000040(k) | A000040(k+1) = p+6 or A000040(k+2) = p+6 } = A031924 U A007529. (End)

A046117 Primes p such that p-6 is also prime. (Upper of a pair of sexy primes.)

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 37, 43, 47, 53, 59, 67, 73, 79, 89, 103, 107, 109, 113, 137, 157, 163, 173, 179, 197, 199, 229, 233, 239, 257, 263, 269, 277, 283, 313, 317, 337, 353, 359, 373, 379, 389, 439, 449, 463, 467, 509, 547, 563, 569, 577, 593, 599, 607, 613
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [p:p in PrimesInInterval(7,650)| IsPrime(p-6)]; // Marius A. Burtea, Jan 03 2020
  • Mathematica
    q=6; a={}; Do[p1=Prime[n]; p2=p1+q; If[PrimeQ[p2], AppendTo[a, p2]], {n, 7^2}]; a "and/or" Select[Prime[Range[3, 7^2]], PrimeQ[ # ]&&PrimeQ[ #-6]&] (* Vladimir Joseph Stephan Orlovsky, Aug 07 2008 *)
    Select[Prime[Range[4,200]],PrimeQ[#-6]&] (* Harvey P. Dale, Mar 31 2018 *)
  • PARI
    forprime(p=2,1e4,if(isprime(p-6),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    

Formula

a(n) = A087695(n) + 3.
a(n) = A023201(n) + 6. - M. F. Hasler, Jan 02 2020

Extensions

Name edited by M. F. Hasler, Jan 02 2020

A098424 Number of prime triples (p,q,r) <= n with p

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, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 07 2004

Keywords

Comments

Convention: a prime triple is <= n iff its smallest member is <= n;
a(n) <= A098428(n).

Examples

			a(15) = #{(5,7,11),(7,11,13),(11,13,17),(13,17,19)} = 4.
		

Crossrefs

Programs

  • Haskell
    a098424 n = length [(p,q,r) | p <- takeWhile (<= n) a000040_list,
                let r = p + 6, a010051 r == 1, q <- [p+1..r-1], a010051 q == 1]
    -- Reinhard Zumkeller, Nov 15 2011
  • Mathematica
    With[{pts=Select[Partition[Prime[Range[1200]],3,1],Last[#]-First[#] == 6&]}, Table[Count[pts,?(First[#]<=n&)],{n,110}]] (* _Harvey P. Dale, Nov 09 2011 *)

A098429 Number of cousin prime pairs (p, p+4) with p <= n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 07 2004

Keywords

Comments

Convention: a prime pair is <= n iff its smallest member is <= n.
Except for (3, 7), there is only 1 pair congruence class for cousin primes, i.e. (+1, -1) (mod 6). [Daniel Forgues, Aug 05 2009]

Examples

			First cousin prime pairs: (3,7),(7,11),(13,17),(19,23), ...
therefore the sequence starts: 0 0 1 1 1 1 2 2 2 2 2 2 3 ...
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[PrimeQ[i]&&PrimeQ[i+4],1,0],{i,1,100}]] (* Seiichi Kirikami, May 28 2017 *)

Extensions

Edited by Daniel Forgues, Aug 01 2009

A226068 The sum of the positive integers not exceeding 2n that are representable as the sum of two successive sexy primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 16, 16, 36, 36, 36, 36, 64, 64, 96, 96, 96, 96, 136, 136, 136, 136, 136, 136, 188, 188, 188, 188, 188, 188, 188, 188, 256, 256, 256, 256, 256, 256, 336, 336, 336, 336, 424, 424, 424, 424, 424
Offset: 1

Views

Author

Wesley Ivan Hurt, May 24 2013

Keywords

Comments

4 divides a(n) for n > 0.

Crossrefs

Programs

  • Maple
    with(numtheory); A226068:=n->sum( 2*i*(pi(i-3) - pi(i-4)) * (pi(i+3) - pi(i+2)) , i = 1..n);
    seq(A226068(k), k = 1..70);

Formula

a(n) = 2*Sum_{i=1..n} i * (pi(i-3) - pi(i-4)) * (pi(i+3) - pi(i+2)), where pi is the prime counting function (A000720).
a(n) = Sum_{i=1..2*n} c(i), where c is the characteristic function of A104010. - R. J. Mathar, May 28 2013

A341843 Number of sexy consecutive prime pairs below 2^n.

Original entry on oeis.org

0, 0, 0, 0, 1, 4, 7, 13, 25, 45, 80, 136, 251, 443, 784, 1377, 2420, 4312, 7756, 14106, 25554, 46776, 85774, 157325, 290773, 538520, 1000321, 1861364, 3473165, 6493997, 12167342, 22851920, 42987462, 81018661, 152945700, 289206487, 547722346, 1038786862
Offset: 1

Views

Author

Artur Jasinski, Feb 21 2021

Keywords

Comments

a(n) is the number of pairs of consecutive sexy primes {A023201, A046117} less than 2^n.
For each n from 9 through 48, the most frequently occurring difference between consecutive primes is 6. On p. 108 of the article by Odlyzko et al., the authors estimate that around n=117, the jumping champion (i.e., the most frequently occurring difference between consecutive primes) becomes 30, and around n=1412 it becomes 210. Successive jumping champions are conjecturaly the primorial numbers A002110.
Data for n >= 15 taken from Marek Wolf's prime gaps computation.
For the number of pairs of consecutive primes below 10^n having a difference of 6, see A093738.
For the number of sexy primes less than 10^n, see A080841.
There are 8 known cases in which a power of 2 falls between the members of the sexy consecutive prime pair (see A220951), but if a pair (p, p+6) is such that p < 2^n < p+6, that pair is not counted in a(n).

Examples

			a(6)=4 because 2^6=64 and we have 4 sexy consecutive prime pairs less than 64: {23,29}, {31,37}, {47,53}, {53,59}.
		

Crossrefs

Programs

  • Mathematica
    pp = {}; Do[kk = 0; Do[If[Prime[m + 1] - Prime[m] == 6, kk = kk + 1], {m, 2, PrimePi[2^n] - 1}]; AppendTo[pp, kk], {n, 4, 20}]; pp
Showing 1-6 of 6 results.