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 71 results. Next

A174042 Places n for which A046132(n) and A006512(n) is a twin prime pair.

Original entry on oeis.org

1, 9, 10, 24, 28, 67, 195, 361, 362, 382, 459, 462, 470, 759, 765, 766, 794, 864, 869, 909, 1189, 1300, 1303, 1374, 1378, 1642, 1657, 1659, 3727, 3755, 4187, 4368, 4413, 4677, 4684, 4721, 4927, 4945, 5221, 5270, 5313, 5409, 5627, 5945, 7587, 7588, 7789
Offset: 1

Views

Author

Vladimir Shevelev, Mar 06 2010

Keywords

Examples

			1 is in the sequence because A046132(1)=7 and A006512(1)=5 are twin primes.
		

Crossrefs

Programs

  • 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:
    A046132 := proc(n) 4+A023200(n) ; end proc:
    A001359 := proc(n) option remember; if n = 1 then 3; else p := nextprime(procname(n-1)) ; while not isprime(p+2) do p := nextprime(p) ; end do: p ; end if; end proc:
    A006512 := proc(n) 2+A001359(n) ; end proc:
    for n from 1 do if A046132(n)+2 = A006512(n) or A046132(n) = A006512(n)+2 then printf("%d,\n",n); end if; end do: # R. J. Mathar, Nov 03 2011

Extensions

Extended beyond 28 by R. J. Mathar, Nov 03 2011
More terms from Michel Marcus, Dec 19 2018

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

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

A056956 Numbers n such that 6n+1 and 6n+5 are both primes.

Original entry on oeis.org

1, 2, 3, 6, 7, 11, 13, 16, 17, 18, 21, 27, 32, 37, 38, 46, 51, 52, 58, 63, 66, 73, 76, 77, 81, 83, 102, 107, 112, 123, 126, 128, 137, 142, 143, 146, 147, 151, 156, 161, 168, 181, 182, 202, 213, 216, 217, 237, 238, 241, 247, 248, 258, 261, 263, 266, 268, 277, 282
Offset: 1

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

Note that if prime p>3 then p mod 6 = 1 or 5.

Examples

			a(2)=2 since 6*2+1=13 and 6*2+5=17 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300], And @@ PrimeQ /@ ({1, 5} + 6#) &] (* Ray Chandler, Jun 29 2008 *)
  • PARI
    is(n)=isprime(n*6+1)&&isprime(n*6+5) \\ M. F. Hasler, Apr 05 2017

Formula

a(n) = (A023200(n+1)-1)/6 = (A046132(n+1)-5)/6 = A047847(n+1)/3
a(n) = floor(A087679(n+1)/6). - M. F. Hasler, Apr 05 2017

Extensions

Edited by N. J. A. Sloane, Nov 07 2006

A094343 List of pairs of primes (p, q) with q - p = 4.

Original entry on oeis.org

3, 7, 7, 11, 13, 17, 19, 23, 37, 41, 43, 47, 67, 71, 79, 83, 97, 101, 103, 107, 109, 113, 127, 131, 163, 167, 193, 197, 223, 227, 229, 233, 277, 281, 307, 311, 313, 317, 349, 353, 379, 383, 397, 401, 439, 443, 457, 461, 463, 467, 487, 491, 499, 503, 613, 617, 643
Offset: 1

Views

Author

Gerard Schildberger, Jun 04 2004

Keywords

Comments

The two primes p and p+4 are not necessarily consecutive primes (for that, see A111980).
The pairs are listed in order, sorted by their smallest member. - N. J. A. Sloane, Dec 27 2019

Examples

			The pairs are (3,7), (7,11), (13,17), etc.
		

Crossrefs

Almost identical to A111980.
Union of A023200 and A046132.
Cf. twin primes (A001097).
See also A000040, A111981, A001097.
For a gap of 6 (which initially is very common) see A140546.

Programs

  • Mathematica
    Flatten[{#,#+4}&/@Select[Prime[Range[200]],PrimeQ[#+4]&]] (* Harvey P. Dale, Apr 13 2011 *)
  • PARI
    isok(n) = (isprime(n) && isprime(n+4)) || (isprime(n-4) && isprime(n)); \\ Michel Marcus, Aug 26 2013

Formula

a(2*n-1)=A023200(n). a(2*n)=A046132(n).

Extensions

Description was corrupted up during editing; correct description restored Aug 21 2005.
a(3) = 7 added by Vincenzo Librandi, May 06 2016

A218867 Number of prime pairs {p,q} with p>q and {p-4,q+4} also prime such that p+(1+(n mod 6))q=n if n is not congruent to 4 (mod 6), and p-q=n and q

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 2, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 0, 1, 2, 2, 2, 2, 0, 2, 2, 1, 1, 1, 2, 1, 0, 0, 1, 0, 2, 2, 0, 2, 1, 3, 0, 1, 1, 2, 2, 1, 0, 3, 2, 3, 0, 2, 1, 4, 1, 1, 2, 1, 3, 2
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 13 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>50000 with n different from 50627, 61127, 66503.
This conjecture implies that there are infinitely many cousin prime pairs. It is similar to the conjectures related to A219157 and A219055.

Examples

			a(20)=1 since 20=11+3*3 with 11-4 and 3+4 prime. a(28)=1 since 28=41-13 with 41-4 and 13+4 prime.
		

Crossrefs

Programs

  • Mathematica
    c[n_]:=c[n]=If[Mod[n+2,6]==0,1,-1-Mod[n,6]]; d[n_]:=d[n]=2+If[Mod[n+2,6]>0,Mod[n,6],0]; a[n_]:=a[n]=Sum[If[PrimeQ[Prime[k]+4] == True && PrimeQ[n+c[n]Prime[k]] == True && PrimeQ[n+c[n]Prime[k]-4]==True,1,0], {k,1,PrimePi[(n-1)/d[n]]}]; Do[Print[n," ",a[n]], {n,100}]

A031505 Upper prime of a difference of 4 between consecutive primes.

Original entry on oeis.org

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, 1451
Offset: 1

Views

Author

Keywords

Crossrefs

Essentially the same as A046132.

Programs

  • Maple
    for i from 1 to 232 do if ithprime(i+1) = ithprime(i) + 4 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007
  • Mathematica
    Select[Partition[Prime[Range[250]],2,1],#[[2]]-#[[1]]==4&][[All,2]] (* Harvey P. Dale, Feb 02 2023 *)

Formula

a(n) = A029710(n-1) + 4 = A029708(n) + 2.

Extensions

Corrected and extended by Henry Bottomley, Jul 18 2000
Definition clarified by Harvey P. Dale, Feb 02 2023

A143206 Product of the n-th cousin prime pair.

Original entry on oeis.org

21, 77, 221, 437, 1517, 2021, 4757, 6557, 9797, 11021, 12317, 16637, 27221, 38021, 50621, 53357, 77837, 95477, 99221, 123197, 145157, 159197, 194477, 210677, 216221, 239117, 250997, 378221, 416021, 455621, 549077, 576077, 594437, 680621
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 12 2008

Keywords

Comments

Intersection of A143203 and A001358.
Sum_{n>=2} 1/a(n) > 0.02187310784. - R. J. Mathar, Jan 23 2013

Examples

			a(1) = 3*7 = 3*(3+4) = 21;
a(2) = 7*11 = 7*(7+4) = 77;
a(3) = 13*17 = 13*(13+4) = 221;
a(4) = 19*23 = 19*(19+4) = 437.
		

Crossrefs

Programs

  • Haskell
    a143206 n = a143206_list !! (n-1)
    a143206_list = (3*7) : f a000040_list where
       f (p:ps@(p':_)) | p'-p == 4 = (p*p') : f ps
                       | otherwise = f ps
    -- Reinhard Zumkeller, Sep 13 2011
    
  • Magma
    [(p*(p+4)): p in PrimesUpTo(1000)| IsPrime(p+4)]; // Vincenzo Librandi, Jan 04 2018
    
  • Mathematica
    fQ[n_] := Block[{fi = FactorInteger@ n}, Last@# & /@ fi == {1, 1} && Differences[ First@# & /@ fi] == {4}]; Select[ Range@ 700000, fQ] (* Robert G. Wilson v, Feb 08 2012 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (isprime(q=p+4), print1(p*q, ", "))); \\ Michel Marcus, Jan 04 2018

Formula

a(n) = A023200(n)*A046132(n).

A160440 Smaller member of a pair (p,q) of cousin primes such that p and q are in different centuries.

Original entry on oeis.org

97, 397, 499, 1297, 1597, 1999, 2797, 3697, 4999, 6199, 6997, 7699, 9199, 10099, 10597, 12097, 13099, 16699, 18397, 20899, 21397, 21499, 21799, 23197, 23599, 25999, 26497, 27697, 27799, 27997, 32299, 32797, 33199, 34297, 35797, 38197, 38299, 39499, 42697
Offset: 1

Views

Author

Ki Punches, May 13 2009

Keywords

Comments

Sequence is probably infinite.
Dickson's conjecture implies there are infinitely many pairs of primes (100*k-3, 100*k+1) and infinitely many pairs of primes (100*k-1, 100*k+3). - Robert Israel, Mar 28 2023
It appears that every integer occurs as the difference round((a(n+1)-a(n))/100); all numbers 1..298 occur as these differences for a(n) < 1000000000. - Hartmut F. W. Hoft, May 18 2017

Examples

			Cousin primes 1597 and 1601 are in successive (that is 16th and 17th) centuries.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    for i from 1 while count < 100 do
      if ((i mod 3 = 1) and isprime(100*i-3) and isprime(100*i+1)) then
         R:= R, 100*i-3; count:= count+1
      elif ((i mod 3 = 2) and isprime(100*i-1) and isprime(100*i+3)) then
         R:= R, 100*i-1; count:= count+1
    fi od:
    R; # Robert Israel, Mar 28 2023
  • Mathematica
    a160440[n_] := Map[Last, Select[Map[{NextPrime[#, 1], NextPrime[#, -1]}&, Range[100, n, 100]], First[#]-Last[#]==4&]]
    a160440[43000] (* data *) (* Hartmut F. W. Hoft, May 18 2017 *)

Formula

{A023200(n): [A023200(n)/100] <> [A046132(n)/100]}, where [..]=floor(..).

Extensions

Edited by R. J. Mathar, May 14 2009

A173037 Numbers k such that k-4, k-2, k+2 and k+4 are prime.

Original entry on oeis.org

9, 15, 105, 195, 825, 1485, 1875, 2085, 3255, 3465, 5655, 9435, 13005, 15645, 15735, 16065, 18045, 18915, 19425, 21015, 22275, 25305, 31725, 34845, 43785, 51345, 55335, 62985, 67215, 69495, 72225, 77265, 79695, 81045, 82725, 88815, 97845
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 07 2010

Keywords

Comments

Average k of the four primes in two twin prime pairs (k-4, k-2) and (k+2, k+4) which are linked by the cousin prime pair (k-2, k+2).
All terms are odd composites; except for a(1) they are multiples of 5.
Subsequence of A087679, of A087680 and of A164385.
All terms except for a(1) are multiples of 15. - Zak Seidov, May 18 2014
One of (k-1, k, k+1) is always divisible by 7. - Fred Daniel Kline, Sep 24 2015
Terms other than a(1) must be equivalent to 1 mod 2, 0 mod 3, 0 mod 5, and 0,+/-1 mod 7. Taken together, this requires terms other than a(1) to have the form 210k+/-15 or 210k+105. However, not all numbers of that form belong to this sequence. - Keith Backman, Nov 09 2023

Examples

			9 is a term because 9-4 = 5 is prime, 9-2 = 7 is prime, 9+2 = 11 is prime and 9+4 = 13 is prime.
		

Crossrefs

Programs

  • Magma
    [ p+4: p in PrimesUpTo(100000) | IsPrime(p) and IsPrime(p+2) and IsPrime(p+6) and IsPrime(p+8) ]; // Klaus Brockhaus, Feb 09 2010
    
  • Mathematica
    Select[Range[100000],AllTrue[#+{4,2,-2,-4},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 30 2015 *)
  • PARI
    is(n)=isprime(n-4) && isprime(n-2) && isprime(n+2) && isprime(n+4) \\ Charles R Greathouse IV, Sep 24 2015
    
  • Python
    from sympy import primerange
    def aupto(limit):
        p, q, r, alst = 2, 3, 5, []
        for s in primerange(7, limit+5):
            if p+2 == q and p+6 == r and p+8 == s: alst.append(p+4)
            p, q, r = q, r, s
        return alst
    print(aupto(10**5)) # Michael S. Branicky, Feb 03 2022

Formula

For n >= 2, a(n) = 15*A112540(n-1). - Michel Marcus, May 19 2014
From Jeppe Stig Nielsen, Feb 18 2020: (Start)
For n >= 2, a(n) = 30*A014561(n-1) + 15.
For n >= 2, a(n) = 10*A007811(n-1) + 5.
a(n) = A007530(n) + 4.
a(n) = A125855(n) + 5. (End)

Extensions

Edited and extended beyond a(9) by Klaus Brockhaus, Feb 09 2010
Showing 1-10 of 71 results. Next