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-10 of 118 results. Next

A172295 Partial sums of A023201.

Original entry on oeis.org

5, 12, 23, 36, 53, 76, 107, 144, 185, 232, 285, 346, 413, 486, 569, 666, 767, 870, 977, 1108, 1259, 1416, 1583, 1756, 1947, 2140, 2363, 2590, 2823, 3074, 3331, 3594, 3865, 4142, 4449, 4760, 5091, 5438, 5791, 6158, 6531, 6914, 7347, 7790, 8247
Offset: 1

Views

Author

Jonathan Vos Post, Jan 30 2010

Keywords

Comments

A023201 is also known as the smaller numbers of pairs of sexy primes. The subsequence of prime partial sums of smaller numbers of pairs of sexy primes begins 5, 23, 53, 107, 569, 977, 1259, 1583, 3331. The subsubsequence of smaller numbers of pairs of sexy prime partial sums of smaller numbers of pairs of sexy primes begins 5, 107, 977. This is to smaller members of sexy prime pairs as A172112 is to A023200 smaller member p of cousin prime pairs (p, p+4)

Examples

			a(19) = 5 + 7 + 11 + 13 + 17 + 23 + 31 + 37 + 41 + 47 + 53 + 61 + 67 + 73 + 83 + 97 + 101 + 103 + 107 = 977, which is A023201(73).
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Select[Prime[Range[120]],PrimeQ[#+6]&]] (* Harvey P. Dale, Jan 18 2020 *)

Extensions

More terms from Sean A. Irvine, Sep 27 2011

A338812 Smaller term of a pair of sexy primes (A023201) such that the distance to next pair (A227346) is a square.

Original entry on oeis.org

7, 13, 37, 97, 103, 223, 307, 331, 457, 541, 571, 853, 877, 1087, 1297, 1423, 1483, 1621, 1867, 1993, 2683, 3457, 3511, 3691, 3761, 3847, 4513, 4657, 4783, 4951, 5227, 5521, 5647, 5861, 6337, 6547, 6823, 7481, 7541, 7681, 7717, 7753, 7873, 8287, 8521, 8887, 9007, 9397, 10267, 10453
Offset: 1

Views

Author

Claude H. R. Dequatre, Nov 10 2020

Keywords

Comments

Considering the 10^6 sexy prime pairs from (5,11) to (115539653,115539659), we note the following:
65340 sequence terms (6.5%) are linked to a distance between two consecutive sexy prime pairs which is a square.
List of the 16 classes of distances which are squares: 4,16,36,64,100,144,196,256,324,400,484,576,676,784,900,1024.
The frequency of the distances which are squares decreases when their size increases, with a noticeable higher frequency for the distance 36.
First 20 distances which are squares with in parentheses the subtraction of the smallest members of the related two consecutive sexy prime pairs: 4 (11-7), 4 (17-13),4 (41-37),4 (101-97),4 (107-103),4 (227-223),4 (311-307), 16 (347-331),4 (461-457),16 (557-541),16 (587-571),4 (857-853), 4 (881-877), 4 (1091-1087),4 (1301-1297),4 (1427-1423),4 (1487-1483),36 (1657-1621), 4 (1871-1867),4 (1997-1993).

Examples

			a(2)=13 is in the sequence because the two consecutive sexy prime pairs being (13,19) and (17,23),the distance between them is 17-13=4 which is a square (2^2).
73 is not in the sequence because the two consecutive sexy prime pairs being (73,79) and (83,89),the distance between them is 83-73=10 which is not a square.
		

Crossrefs

Programs

  • Maple
    count:= 0: sp:= 5: R:= NULL:
    p:= sp;
    while count < 100  do
        p:= nextprime(p);
        if isprime(p+6) then
          d:= p - sp;
          if issqr(d) then
            count:= count+1; R:= R, sp;
          fi;
          sp:= p;
        fi;
    od:
    R; # Robert Israel, May 08 2024
  • PARI
    lista(nn) = {my(vs = select(x->(isprime(x) && isprime(x+6)), [1..nn]), vd = vector(#vs-1, k, vs[k+1] - vs[k]), vk = select(issquare, vd, 1)); vector(#vk, k, vs[vk[k]]);} \\ Michel Marcus, Nov 14 2020
  • R
    primes<-generate_n_primes(7000000)
    Matrix_1<-matrix(c(primes),nrow=7000000,ncol=1,byrow=TRUE)
    p1<-c(0)
    p2<-c(0)
    k<-c(0)
    distance<-c(0)
    distance_square<-(0)
    Matrix_2<-cbind(Matrix_1,p1,p2,k,distance,distance_square)
    counter=0
    j=1
    while(j<= 7000000){
      p<-(Matrix_2[j,1])+6
      if(is_prime(p)){
        counter=counter+1
        Matrix_2[counter,2]<-(p-6)
        Matrix_2[counter,3]<-p
      }
      j=j+1
    }
    a_n<-c()
    k=1
    while(k<=1000000){
      Matrix_2[k,4]<-k
      dist<-Matrix_2[k+1,2]-Matrix_2[k,2]
      Matrix_2[k,5]<-dist
      if(sqrt(dist)%%1==0){
        Matrix_2[k,6]<-dist
        a_n<-append(a_n,Matrix_2[k,2])
      }
      k=k+1
    }
    View(Matrix_2)
    View(a_n)
    

A255472 Number of decompositions of 2n into sums of two primes p <= q such that one or both p and q are elements of A023201.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Feb 23 2015

Keywords

Comments

Conjecture: for all n > 3, a(n) > 0.
If 2n = p + q and p+6 is also a prime, 2n+6 can be written as the sum of two primes p+6 and q.
The conjecture is weaker than a conjecture of Sun posed in 2012 (see A219055). - Zhi-Wei Sun, Mar 18 2015

Examples

			n=4: 2n=8=3+5, 5+6=11 is also a prime number. This is the only occurrence, so a(4)=1.
n=5: 2n=10=3+7=5+5. Both 5+6=11 and 7+6=13 are prime numbers. Two occurrences found, so a(5)=2.
		

Crossrefs

Programs

  • Mathematica
    Table[e = 2 n; ct = 0; p1 = 2; While[p1 = NextPrime[p1]; p1 <= n, p2 = e - p1; If[PrimeQ[p2], If[PrimeQ[p1 + 6] || PrimeQ[p2 + 6], ct++]]]; ct, {n, 1, 100}]
  • PARI
    a(n) = {nb = 0; forprime(p=2, 2*n, if ((q=2*n-p) && (q <= p) && isprime(q=2*n-p) && (isprime(q+6) || isprime(p+6)), nb++);); nb;} \\ Michel Marcus, Mar 01 2015

A022004 Initial members of prime triples (p, p+2, p+6).

Original entry on oeis.org

5, 11, 17, 41, 101, 107, 191, 227, 311, 347, 461, 641, 821, 857, 881, 1091, 1277, 1301, 1427, 1481, 1487, 1607, 1871, 1997, 2081, 2237, 2267, 2657, 2687, 3251, 3461, 3527, 3671, 3917, 4001, 4127, 4517, 4637, 4787, 4931, 4967, 5231, 5477
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A001359. - R. J. Mathar, Feb 10 2013
All terms are congruent to 5 (mod 6). - Matt C. Anderson, May 22 2015
Intersection of A001359 and A023201. - Zak Seidov, Mar 12 2016

Crossrefs

Cf. A073648, A098412, A372247 (subsequence).
Subsequence of A007529.

Programs

  • Magma
    [ p: p in PrimesUpTo(10000) | IsPrime(p+2) and IsPrime(p+6) ] // Vincenzo Librandi, Nov 19 2010
    
  • Maple
    A022004 := proc(n)
        if n= 1 then
            5;
        else
            for a from procname(n-1)+2 by 2 do
                if isprime(a) and isprime(a+2) and isprime(a+6) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jul 11 2012
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[#+2] && PrimeQ[#+6]&] (* Vladimir Joseph Stephan Orlovsky, Mar 30 2011 *)
    Transpose[Select[Partition[Prime[Range[1000]],3,1],Differences[#]=={2,4}&]][[1]] (* Harvey P. Dale, Dec 24 2011 *)
  • PARI
    is(n)=isprime(n)&&isprime(n+2)&&isprime(n+6) \\ Charles R Greathouse IV, Jul 01 2013
    
  • Python
    from sympy import primerange
    def aupto(limit):
      p, q, alst = 2, 3, []
      for r in primerange(5, limit+7):
        if p+2 == q and p+6 == r: alst.append(p)
        p, q = q, r
      return alst
    print(aupto(5477)) # Michael S. Branicky, May 11 2021

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

A031924 Primes followed by a gap of 6, i.e., next prime is p + 6.

Original entry on oeis.org

23, 31, 47, 53, 61, 73, 83, 131, 151, 157, 167, 173, 233, 251, 257, 263, 271, 331, 353, 367, 373, 383, 433, 443, 503, 541, 557, 563, 571, 587, 593, 601, 607, 647, 653, 677, 727, 733, 751, 941, 947, 971, 977, 991, 1013, 1033, 1063, 1097, 1103, 1117, 1123, 1181
Offset: 1

Views

Author

Keywords

Comments

Original name: Lower prime of a difference of 6 between consecutive primes.
Conjecture: The sequence is infinite and for every n >= 7746, a(n+1) < a(n)^(1+1/n). Namely for n >= 7746, a(n)^(1/n) is a strictly decreasing function of n (See comment lines of the sequence A248855). - Jahangeer Kholdi and Farideh Firoozbakht, Nov 29 2014

Examples

			23 is a term as the next prime 29 = 23 + 6.
		

Crossrefs

Cf. A001359, A023201, A031925; A031924 and A007529 together give A023201.

Programs

  • GAP
    P:=Filtered([1..1200],IsPrime);;
    List(Filtered([1..Length(P)-1],i->P[i+1]-P[i]=6),k->P[k]); # Muniru A Asiru, Jan 30 2019
  • Magma
    [p: p in PrimesUpTo(1200) | NextPrime(p)-p eq 6]; // Bruno Berselli, Apr 09 2013
    
  • Maple
    A031924 := proc(n)
        option remember;
        if n = 1 then
            return 23;
        else
            p := nextprime(procname(n-1)) ;
            q := nextprime(p) ;
            while q-p <> 6 do
                p := q ;
                q := nextprime(p) ;
            end do:
            return p;
        end if;
    end proc: # R. J. Mathar, Jan 23 2013
  • Mathematica
    Transpose[Select[Partition[Prime[Range[200]], 2, 1], Last[#] - First[#] == 6 &]][[1]] (* Bruno Berselli, Apr 09 2013 *)
  • PARI
    is(n)=isprime(n)&&nextprime(n+1)-n==6 \\ Charles R Greathouse IV, Mar 21 2013
    
  • PARI
    apply( A031924(n,p=2,show=0,g=6)={forprime(q=p+1,, p+g!=(p=q) || (show&&print1(p-g",")) || n-- || return(p-g))}, [1..99]) \\ Use nxt(p)=A031924(1,p) to get the term following p, use show=1 to print all a(1..n), g to select a different gap. - M. F. Hasler, Jan 02 2020
    

Extensions

New name from M. F. Hasler, Jan 02 2020

A007529 Prime triples: p; p+2 or p+4; p+6 all prime.

Original entry on oeis.org

5, 7, 11, 13, 17, 37, 41, 67, 97, 101, 103, 107, 191, 193, 223, 227, 277, 307, 311, 347, 457, 461, 613, 641, 821, 823, 853, 857, 877, 881, 1087, 1091, 1277, 1297, 1301, 1423, 1427, 1447, 1481, 1483, 1487, 1607, 1663, 1693, 1783, 1867, 1871, 1873, 1993, 1997
Offset: 1

Views

Author

Keywords

Comments

Or, prime(m) such that prime(m+2) = prime(m)+6. - Zak Seidov, May 07 2012

References

  • H. Riesel, "Prime numbers and computer methods for factorization", Progress in Mathematics, Vol. 57, Birkhauser, Boston, 1985, Chap. 4, see p. 65.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [1..310] | (NthPrime(n)+6) eq NthPrime(n+2)]; // Bruno Berselli, May 07 2012
    
  • Maple
    N:= 10000: # to get all terms <= N
    Primes:= select(isprime, [seq(2*i+1, i=1..floor((N+5)/2))]):locs:= select(t -> Primes[t+2]-Primes[t]=6, [$1..nops(Primes)-2]):
    Primes[locs]; # Robert Israel, Apr 30 2015
  • Mathematica
    ptrsQ[n_]:=PrimeQ[n+6]&&(PrimeQ[n+2]||PrimeQ[n+4])
    Select[Prime[Range[400]],ptrsQ]  (* Harvey P. Dale, Mar 08 2011 *)
  • PARI
    p=2;q=3;forprime(r=5,1e4,if(r-p==6,print1(p", "));p=q;q=r) \\ Charles R Greathouse IV, May 07 2012

Formula

a(n) = A098415(n) - 6. - Zak Seidov, Apr 30 2015

A320701 Indices of primes followed by a gap (distance to next larger prime) of 6.

Original entry on oeis.org

9, 11, 15, 16, 18, 21, 23, 32, 36, 37, 39, 40, 51, 54, 55, 56, 58, 67, 71, 73, 74, 76, 84, 86, 96, 100, 102, 103, 105, 107, 108, 110, 111, 118, 119, 123, 129, 130, 133, 160, 161, 164, 165, 167, 170, 174, 179, 184, 185, 187, 188, 194, 195, 199, 200, 202, 208, 210, 216, 218, 219, 227, 231
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes given in A031924.
Subsequence of indices of sexy primes A023201.

Crossrefs

Equals A000720 o A031924.
Row 3 of A174349.
Indices of 6's in A001223.
Cf. A029707, A029709, A320702, A320703, ..., A320720 (analog for gaps 2, 4, 8, 10, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

  • Mathematica
    Position[Differences[Prime[Range[250]]],6]//Flatten (* Harvey P. Dale, Oct 13 2022 *)
  • PARI
    A(N=100,g=6,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)} \\ returns the list of first N terms of the sequence

Formula

a(n) = A000720(A031924(n)).
A320701 = { i > 0 | prime(i+1) = prime(i) + 6 } = A001223^(-1)({6}).

A023271 Primes p such that p, p+6, p+12, p+18 are all primes.

Original entry on oeis.org

5, 11, 41, 61, 251, 601, 641, 1091, 1481, 1601, 1741, 1861, 2371, 2671, 3301, 3911, 4001, 5101, 5381, 5431, 5641, 6311, 6361, 9461, 11821, 12101, 12641, 13451, 14621, 14741, 15791, 15901, 17471, 18211, 19471, 20341, 21481, 23321, 24091, 26171, 26681
Offset: 1

Views

Author

Keywords

Comments

Smallest member of a "sexy" prime quadruple.
For n > 1, a(n) ends in 1. - Robert Israel, Jul 16 2015
The only sexy prime quintuple corresponding to (p, p+6, p+12, p+18, p+24) starts with a(1) = 5, so this quintuple is (5, 11, 17, 23, 29) (see Wikipedia link and A206039). - Bernard Schott, Mar 10 2023

Crossrefs

Programs

  • Magma
    [p: p in PrimesInInterval(2, 1000000) | forall{i: i in [ 6, 12, 18] | IsPrime(p+i)}]; // Vincenzo Librandi, Jul 15 2015
    
  • Maple
    for a to 2*10^5 do
    if `and`(isprime(a), isprime(a+6), isprime(a+12), isprime(a+18))
    then print(a);
    end if;
    end do;
    # code produces 109 primes
    # Matt C. Anderson, Jul 15 2015
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[# + 6] && PrimeQ[# + 12] && PrimeQ[# + 18] &] (* Vincenzo Librandi, Jul 15 2015 *)
    (* The following program uses the AllTrue function from Mathematica version 10 *) Select[Prime[Range[3000]], AllTrue[# + {6, 12, 18}, PrimeQ] &] (* Harvey P. Dale, Jun 06 2017 *)
  • PARI
    main(size)=my(v=vector(size),i,r=1,p);for(i=1,size,while(1,p=prime(r);if(isprime(p+6)&&isprime(p+12)&&isprime(p+18),v[i]=p;r++;break,r++))); v \\ Anders Hellström, Jul 16 2015

Extensions

Edited by N. J. A. Sloane, Aug 04 2009 following a suggestion from Daniel Forgues

A006489 Numbers k such that k-6, k, and k+6 are primes.

Original entry on oeis.org

11, 13, 17, 23, 37, 47, 53, 67, 73, 103, 107, 157, 173, 233, 257, 263, 277, 353, 373, 563, 593, 607, 613, 647, 653, 733, 947, 977, 1097, 1103, 1123, 1187, 1223, 1283, 1297, 1367, 1433, 1453, 1487, 1493, 1607, 1613, 1663, 1747, 1753, 1783, 1867, 1873
Offset: 1

Views

Author

Keywords

Comments

A006562 without the first term 5 is a subsequence. - Zak Seidov, Apr 19 2021

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A023201.
Cf. A006562.

Programs

  • Haskell
    a006489 n = a006489_list !! (n-1)
    a006489_list = filter
       ((== 1) . a010051 . (subtract 6)) $ dropWhile (<= 6) a023201_list
    -- Reinhard Zumkeller, Feb 25 2013
    
  • Mathematica
    Select[Prime[Range[300]],And@@PrimeQ[#+{6,-6}]&] (* Harvey P. Dale, May 21 2012 *)
  • PARI
    is(n)=isprime(n-6) && isprime(n) && isprime(n+6) \\ Charles R Greathouse IV, Feb 07 2017

Extensions

More terms from James Sellers, Dec 24 1999
Showing 1-10 of 118 results. Next