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

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

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

A100418 Numbers k such that 30*k + {1,11,13,17,19,23,29} are all prime.

Original entry on oeis.org

49, 34083, 41545, 48713, 140609, 524027, 616812, 855281, 1314397, 1324750, 1636152, 2281293, 2927134, 3401412, 3605413, 4989341, 5212221, 5284979, 5406303, 5645269, 6141254, 6342728, 7231434, 7347697, 7637329, 8027068, 8161657, 8372756, 8392776, 8567216, 8986096, 9145563
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu), Nov 19 2004

Keywords

Comments

Values are 0 mod 7.
From Peter Munn, Sep 06 2023: (Start)
In each case, the 7 primes are necessarily consecutive.
As A065706 demonstrates, many intervals of 27 integers contain 8 primes, but only A364678(30) = 7 primes can occur between adjacent positive multiples of 30. This is because there are 8 values {1,7,11,13,17,19,23,29} coprime to 30, but they cover every residue class modulo 7, which means at least one of 30*k + {1,7,11,13,17,19,23,29} is divisible by 7.
1 and 29 are in the same residue class, but if we remove any of the other coprime integers there is a class that is not represented in the set. For this sequence, we remove 7, so when k is a multiple of 7, none of 30*k + {1,11,13,17,19,23,29} is a multiple of 2, 3, 5 or 7 and the set can potentially be 7 consecutive primes.
The sequences for the other appropriate subsets of 7 coprime values are A100419-A100423.
(End)

Crossrefs

Programs

  • Magma
    [ n: n in [0..70000000 by 7] | forall{ q: q in [1, 11, 13, 17, 19, 23, 29] | IsPrime(30*n+q) } ]; // Klaus Brockhaus, Feb 24 2011
  • Mathematica
    Select[Range[803*10^4],AllTrue[30#+{1,11,13,17,19,23,29},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 11 2019 *)
  • PARI
    {pav7(mx)= local(wp=[1,11,13,17,19,23,29],v=[],i,j,m); for(k=1,mx, i=k*30;j=1;m=1;while(m&&(j<8),m=isprime(i+wp[j]);j+=1);if(m,v=concat(v,k))); return(v)}
    

Extensions

Edited by Don Reble, Nov 17 2005

A157834 Numbers n such that 3n-2 and 3n+2 are both prime.

Original entry on oeis.org

3, 5, 7, 13, 15, 23, 27, 33, 35, 37, 43, 55, 65, 75, 77, 93, 103, 105, 117, 127, 133, 147, 153, 155, 163, 167, 205, 215, 225, 247, 253, 257, 275, 285, 287, 293, 295, 303, 313, 323, 337, 363, 365, 405, 427, 433, 435, 475, 477, 483, 495, 497, 517
Offset: 1

Views

Author

Kyle D. Balliet, Mar 07 2009

Keywords

Comments

Barycenter of cousin primes (A029708; see also A029710, A023200, A046132), divided by 3. When p>3 and p+4 both are prime, then p = 1 (mod 6) and p+2 = 3 (mod 6). - M. F. Hasler, Jan 14 2013

Examples

			15*3 +/- 2 = 43,47 (both prime).
		

Crossrefs

Intersection of A024893 and A153183.

Programs

  • Magma
    [n: n in [1..1000]|IsPrime(3*n-2)and IsPrime(3*n+2)] // Vincenzo Librandi, Dec 13 2010
  • Maple
    select(t -> isprime(3*t+2) and isprime(3*t-2), [seq(t,t=3..1000,2)]); # Robert Israel, May 28 2017
  • Mathematica
    Select[Range[600],AllTrue[3#+{2,-2},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 03 2019 *)

Formula

Intersection of A024893 and A153183.
a(n) = A029708(n)/3. - Zak Seidov, Aug 07 2009
a(n) = A056956(n)*2+1 = (A029710(n)+2)/3 = (A023200(n+1)+2)/3. - M. F. Hasler, Jan 14 2013

A364678 Maximum number of primes between consecutive multiples of n, as permitted by divisibility considerations.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 5, 7, 7, 6, 7, 7, 7, 7, 8, 7, 8, 9, 8, 10, 8, 10, 10, 10, 11, 11, 11, 10, 11, 11, 11, 12, 12, 12, 12, 13, 12, 13, 14, 13, 13, 14, 14, 15, 15, 14, 15, 15, 15, 16, 15, 15, 16, 16, 17, 16, 17, 18, 18, 18, 18, 18, 17, 19, 19, 19, 19, 20, 20, 19, 19, 20, 21, 21
Offset: 1

Views

Author

Brian Kehrig, Aug 24 2023

Keywords

Comments

Alternatively: a(n) = the maximum number of elements of an admissible k-tuple strictly contained in (0,n) such that all elements are relatively prime to n. Recall that an admissible tuple is defined as a tuple of integers with the property that all primes p have at least one residue class that has no intersection with the tuple.
For n > 1, we have a(n) <= A023193(n-1), with equality if (but not only if) n is prime or a power of 2. The smallest n for which it is not an equality is n=14.
Conjecture 1: Every nonnegative integer appears in this sequence.
Conjecture 2: For all n, there is an infinitude of k's such that there are a(n) primes between n*k and n*(k+1).
Conjecture 2 resembles the k-tuples conjecture a.k.a. the first Hardy-Littlewood conjecture, although it is not the same.
A notable value is a(35) = 8. Compare with A000010(210) = 48. This says that between any two consecutive multiples of 210 the 48 values that are not divisible by 2, 3, 5 or 7 are equally distributed between 6 equal divisions of 210; that is, 8 are in the interval [0, 34], 8 in the interval [35, 69], etc. - Peter Munn, Feb 16 2024

Examples

			Between two multiples of 15 (n and n+15), only n+1, n+2, n+4, n+7, n+8, n+11, n+13, and n+14 could possibly be prime based on divisibility by 3 and 5. However, 4 of these are even and 4 are odd, so at most 4 of them can be prime. Thus, a(15)=4.
		

Crossrefs

Multiples of n following which the maximum number of primes occur for particular n: A005097 (2), A144769 (3), A123986 (4), A056956 (6), A007811 (10), A123985 (12), A309871 (18).

Programs

  • Python
    # see Links section

A307561 Numbers k such that both 6*k - 1 and 6*k + 5 are prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 9, 14, 17, 18, 22, 28, 29, 32, 38, 39, 42, 43, 44, 52, 58, 59, 64, 74, 77, 84, 93, 94, 98, 99, 107, 108, 109, 113, 137, 143, 147, 157, 158, 162, 163, 169, 182, 183, 184, 197, 198, 203, 204, 213, 214, 217, 227, 228, 238, 239, 247, 248, 249, 259, 267, 268, 269, 312, 317, 318, 329, 333, 344
Offset: 1

Views

Author

Sally Myers Moite, Apr 14 2019

Keywords

Comments

There are 146 terms below 10^3, 831 terms below 10^4, 5345 terms below 10^5, 37788 terms below 10^6 and 280140 terms below 10^7.
Prime pairs differing by 6 are called "sexy" primes. Other prime pairs with difference 6 are of the form 6n + 1 and 6n + 7.
Numbers in this sequence are those which are not 6cd + c - d - 1, 6cd + c - d, 6cd - c + d - 1 or 6cd - c + d, that is, they are not (6c - 1)d + c - 1, (6c - 1)d + c, (6c + 1)d - c - 1 or (6c + 1)d - c.

Examples

			a(2) = 2, so 6(2) - 1 = 11 and 6(2) + 5 = 17 are both prime.
		

Crossrefs

Primes differing from each other by 6 are A023201, A046117.
Similar sequences for twin primes are A002822, A067611, for "cousin" primes A056956, A186243.
Intersection of A024898 and A059325.
Cf. also A307562, A307563.

Programs

  • Mathematica
    Select[Range[500], PrimeQ[6# - 1] && PrimeQ[6# + 5] &] (* Alonso del Arte, Apr 14 2019 *)
  • PARI
    is(k) = isprime(6*k-1) && isprime(6*k+5); \\ Jinyuan Wang, Apr 20 2019

A307562 Numbers k such that both 6*k + 1 and 6*k + 7 are prime.

Original entry on oeis.org

1, 2, 5, 6, 10, 11, 12, 16, 17, 25, 26, 32, 37, 45, 46, 51, 55, 61, 62, 72, 76, 90, 95, 100, 101, 102, 121, 122, 125, 137, 142, 146, 165, 172, 177, 181, 186, 187, 205, 215, 216, 220, 237, 241, 242, 247, 257, 270, 276, 277, 282, 290, 291, 292, 296, 297, 310, 311, 312, 331, 332, 335, 347, 355, 356, 380, 381, 390
Offset: 1

Views

Author

Sally Myers Moite, Apr 14 2019

Keywords

Comments

There are 138 such numbers between 1 and 1000.
Prime pairs that differ by 6 are called "sexy" primes. Other prime pairs that differ by 6 are of the form 6n - 1 and 6n + 5.
Numbers in this sequence are those which are not 6cd - c - d - 1, 6cd - c - d, 6cd + c + d - 1 or 6cd + c + d, that is, they are not (6c - 1)d - c - 1, (6c - 1)d - c, (6c + 1)d + c - 1 or (6c + 1)d + c.

Examples

			a(3) = 5, so 6(5) + 1 = 31 and 6(5) + 7 = 37 are both prime.
		

Crossrefs

For the primes see A023201, A046117.
Similar sequences for twin primes are A002822, A067611, for "cousin" primes A056956, A186243.
Intersection of A024899 and A153218.
Cf. also A307561, A307563.

Programs

  • Mathematica
    Select[Range[400], AllTrue[6 # + {1, 7}, PrimeQ] &] (* Michael De Vlieger, Apr 15 2019 *)
  • PARI
    isok(n) = isprime(6*n+1) && isprime(6*n+7); \\ Michel Marcus, Apr 16 2019

A307563 Numbers k such that both 6k - 1 and 6k + 7 are prime.

Original entry on oeis.org

1, 2, 4, 5, 9, 10, 12, 15, 17, 22, 25, 29, 32, 39, 44, 45, 60, 65, 67, 72, 75, 80, 82, 94, 95, 99, 100, 109, 114, 117, 120, 124, 127, 137, 152, 155, 164, 169, 172, 177, 185, 194, 199, 204, 205, 214, 215, 220, 229, 240, 242, 247, 254, 260, 262, 267, 269, 270, 289, 304, 312, 330, 334, 347, 355, 359, 369, 374, 379, 389
Offset: 1

Views

Author

Sally Myers Moite, Apr 14 2019

Keywords

Comments

There are 140 such numbers between 1 and 1000.
These numbers correspond to all the prime pairs which differ by 8 except 3 and 11.
Numbers in this sequence are those which are not 6cd - c - d - 1, 6cd + c - d, 6cd - c + d or 6cd + c + d - 1, that is, they are not (6c - 1)d - c - 1, (6c - 1)d + c, (6c + 1)d - c or (6c + 1)d + c - 1.

Examples

			a(4) = 5, so 6(5) - 1 = 29 and 6(5) + 7 = 37 are both prime.
		

Crossrefs

The primes are A023202, A092402, A031926.
Similar sequences for twin primes are A002822, A067611, for "cousin" primes A056956, A186243.
Intersection of A024898 and A153218.
Cf. also A307561, A307562.

Programs

  • Maple
    select(t -> isprime(6*t-1) and isprime(6*t+7), [$1..500]); # Robert Israel, May 27 2019
  • PARI
    isok(n) = isprime(6*n-1) && isprime(6*n+7); \\ Michel Marcus, Apr 16 2019

A047847 Numbers n such that n + (n+1) and (n+2) + (n+3) are both prime.

Original entry on oeis.org

1, 3, 6, 9, 18, 21, 33, 39, 48, 51, 54, 63, 81, 96, 111, 114, 138, 153, 156, 174, 189, 198, 219, 228, 231, 243, 249, 306, 321, 336, 369, 378, 384, 411, 426, 429, 438, 441, 453, 468, 483, 504, 543, 546, 606, 639, 648, 651, 711, 714, 723, 741, 744, 774, 783, 789
Offset: 1

Views

Author

Keywords

Comments

Except for the first one, all terms are multiples of 3, as can be seen from the formula a(n+1) = 3*A056956(n). - Zak Seidov, Aug 26 2012

Examples

			If n = 6, then 6 + 7 = 13 and 8 + 9 = 17 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[790], And @@ PrimeQ[{2*# + 1, 2*# + 5}] &] (* Jayanta Basu, Aug 11 2013 *)
    Select[Range[800],AllTrue[2#+{1,5},PrimeQ]&] (* Harvey P. Dale, Jan 28 2023 *)
  • PARI
    is_A047847(n)=isprime(n*2+1)&isprime(n*2+5)  \\ - M. F. Hasler, Aug 26 2012

Formula

a(n) = (A023200(n)-1)/2 = (A046132(n)-5)/2 = 3*A056956(n-1) (for n>1).

Extensions

Corrected by Henry Bottomley, Jul 18 2000

A309871 Numbers n for which 18n+1, 18n+5, 18n+7, 18n+11, 18n+13 and 18n+17 are primes.

Original entry on oeis.org

892, 2432, 156817, 806697, 822937, 1377022, 1389412, 1418007, 1619642, 1753552, 2017732, 2058647, 2329302, 2554142, 2703347, 3058772, 3135107, 3326522, 3391797, 3723457, 4126867, 4132782, 4171422, 4411837, 4610252, 6378487, 6440087, 6878987, 6897782, 6991547
Offset: 1

Views

Author

Ely Golden, Aug 21 2019

Keywords

Crossrefs

Programs

  • Mathematica
    tot[n_] := Select[Range[n], CoprimeQ[#, n] &]; m = 18; t = tot[m]; aQ[n_] := AllTrue[m * n + t, PrimeQ]; Select[Range[10^6], aQ] (* Amiram Eldar, Aug 22 2019 *)
  • SageMath
    x = 1
    for i in range(5000000):
        if (18*i+1 in Primes()
        and 18*i+5 in Primes()
        and 18*i+7 in Primes()
        and 18*i+11 in Primes()
        and 18*i+13 in Primes()
        and 18*i+17 in Primes()):
            print(str(x)+" "+str(i))
            x += 1
Showing 1-10 of 11 results. Next