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

A240678 Primes p such that p*10+k is prime for exactly one value of the digit k.

Original entry on oeis.org

11, 29, 41, 47, 71, 79, 83, 131, 137, 139, 151, 163, 173, 181, 191, 227, 257, 263, 277, 281, 293, 307, 311, 313, 359, 383, 449, 491, 503, 509, 557, 563, 569, 577, 587, 593, 601, 617, 647, 659, 661, 677, 683, 719, 739, 743, 751, 809, 821, 827, 857, 877, 881
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			11 is in the sequence because 113 is prime, but 111, 117 and 119 are not prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Total[Boole[PrimeQ[10 #+{1,3,7,9}]]]==1&] (* Harvey P. Dale, Apr 19 2019 *)
  • PARI
    forprime(p=2, 1500, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==1, print1(p, ", ")))
    
  • Python
    from sympy import isprime, primerange
    def ok(p): return sum(1 for k in [1, 3, 7, 9] if isprime(p*10+k)) == 1
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(881)) # Michael S. Branicky, Nov 29 2021

A240679 Primes p such that p*10+k is prime for exactly two values of the digit k.

Original entry on oeis.org

2, 3, 5, 17, 23, 37, 59, 67, 73, 97, 101, 127, 149, 157, 193, 197, 211, 223, 229, 233, 239, 241, 269, 283, 331, 337, 349, 353, 373, 379, 401, 433, 439, 463, 467, 479, 487, 499, 571, 607, 613, 619, 631, 673, 691, 701, 733, 757, 769, 811, 853, 859, 937, 941
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			2 is in the sequence because 23 and 29 are prime, but 21 and 27 are not prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Count[Table[10 #+k,{k,{1,3,7,9}}],?PrimeQ] == 2&] (* _Harvey P. Dale, Jan 24 2019 *)
  • PARI
    forprime(p=2, 1500, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==2, print1(p, ", ")))

A240680 Primes p such that p*10+k is prime for exactly three values of the digit k.

Original entry on oeis.org

7, 13, 31, 43, 61, 103, 109, 199, 271, 367, 409, 421, 523, 541, 547, 787, 823, 829, 883, 1009, 1033, 1117, 1237, 1291, 1669, 1999, 2131, 2161, 2203, 2269, 2437, 2503, 2593, 2671, 2857, 3049, 3253, 3271, 3361, 3559, 3583, 3769, 3823, 4003, 4201, 4339, 4357
Offset: 1

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			7 is in the sequence because 71, 73 and 79 are prime, but 77 is not prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10^4) | {k: k in [1,3,7,9] | IsPrime(p*10+k)} in Subsets({1,3,7,9},3)]; // Bruno Berselli, Apr 10 2014
  • Mathematica
    Select[Prime[Range[600]],Total[Boole[PrimeQ[10#+{1,3,7,9}]]]==3&] (* Harvey P. Dale, Apr 07 2023 *)
  • PARI
    forprime(p=2, 10000, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==3, print1(p, ", ")))
    

A240689 The number of values of the digit k for which prime(n)*10+k is prime.

Original entry on oeis.org

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

Views

Author

Colin Barker, Apr 10 2014

Keywords

Examples

			a(16) = 0 because prime(16) = 53, and 531, 533, 537 and 539 are not prime.
a(5) = 1 because prime(5) = 11, and 113 is prime, but 111, 117 and 119 are not prime.
a(1) = 2 because prime(1) = 2, and 23 and 29 are prime, but 21 and 27 are not prime.
a(4) = 3 because prime(4) = 7, and 71, 73 and 79 are prime, but 77 is not prime.
a(8) = 4 because prime(8) = 19, and 191, 193, 197 and 199 are all prime.
		

Crossrefs

Programs

A242562 Primes p such that 1000p+1, 1000p+3, 1000p+7 and 1000p+9 are prime.

Original entry on oeis.org

13, 1447, 5527, 28201, 36217, 75079, 81157, 95911, 187423, 188677, 202327, 210643, 248077, 263323, 282589, 283267, 423043, 466897, 472597, 478189, 478603, 631273, 640261, 695749, 730111, 736279, 806929, 808021, 917641, 964303, 1018177, 1026547, 1064263, 1108489, 1150861
Offset: 1

Views

Author

Derek Orr, May 17 2014

Keywords

Examples

			130001, 130003, 130007 and 130009 are all prime. Thus 13 is a member of this sequence.
		

Crossrefs

Programs

  • PARI
    for(n=1,10^5,s=prime(n);if(ispseudoprime(1000*s+1) && ispseudoprime(1000*s+3) && ispseudoprime(1000*s+7) && ispseudoprime(1000*s+9),print(s)));
  • Python
    import sympy
    from sympy import isprime
    from sympy import prime
    {print(prime(n)) for n in range(1,10**5) if isprime(1000*prime(n)+1) and isprime(1000*prime(n)+3) and isprime(1000*prime(n)+7) and isprime(1000*prime(n)+9)}
    

A242564 Least prime p such that p*10^n+1, p*10^n+3, p*10^n+7 and p*10^n+9 are all prime.

Original entry on oeis.org

19, 1657, 13, 9001, 283, 115201, 61507, 249439, 375127, 472831, 786823, 172489, 1237, 2359033, 163063, 961981, 1442017, 457, 1208833, 4845583, 1146877, 11550193, 436831, 1911031, 581047, 4504351, 215737, 3685051, 27805381, 1343791, 82491967, 15696349, 20446423
Offset: 1

Views

Author

Derek Orr, May 17 2014

Keywords

Examples

			2*10^3+1 (2001), 2*10^3+3 (2003), 2*10^3+7 (2007) and 2*10^3+9 (2009) are not all prime.
3*10^3+1 (3001), 3*10^3+3 (3003), 3*10^3+7 (3007) and 3*10^3+9 (3009) are not all prime.
5*10^3+1 (5001), 5*10^3+3 (5003), 5*10^3+7 (5007) and 5*10^3+9 (5009) are not all prime.
7*10^3+1 (7001), 7*10^3+3 (7003), 7*10^3+7 (7007) and 7*10^3+9 (7009) are not all prime.
11*10^3+1 (11001), 11*10^3+3 (11003), 11*10^3+7 (11007) and 11*10^3+9 (11009) are not all prime.
13*10^3+1 (13001), 13*10^3+3 (13003), 13*10^3+7 (13007) and 13*10^3+9 (13009) are all prime. Thus, a(3) = 13.
		

Crossrefs

Programs

  • Mathematica
    lpp[n_]:=Module[{c=10^n,p=2},While[Not[AllTrue[p*c+{1,3,7,9},PrimeQ]], p= NextPrime[ p]];p]; Array[lpp,40] (* Harvey P. Dale, Mar 24 2018 *)
  • Python
    import sympy
    from sympy import isprime
    from sympy import prime
    def Pr(n):
      for p in range(1,10**7):
        if isprime(prime(p)*(10**n)+1) and isprime(prime(p)*(10**n)+3) and isprime(prime(p)*(10**n)+7) and isprime(prime(p)*(10**n)+9):
          return prime(p)
    n = 1
    while n < 50:
      print(Pr(n))
      n += 1

A243408 Primes p such that 10*p-1, 10*p-3, 10*p-7 and 10*p-9 are all prime.

Original entry on oeis.org

2, 11, 83, 149, 347, 1301, 1607, 2531, 6299, 7727, 8273, 17117, 20183, 21737, 24371, 26669, 39227, 40277, 53951, 54917, 63347, 66359, 66467, 73637, 82217, 82373, 101537, 102251, 106397, 106871, 117203, 132971, 134033, 135221, 140237, 144701, 146141, 151433, 152597
Offset: 1

Views

Author

Derek Orr, Jun 04 2014

Keywords

Comments

This is a subsequence of A064975.

Examples

			2 is prime, 10*2-1 = 19 is prime, 10*2-3 = 17 is prime, 10*2-7 = 13 is prime, 10*2-9 = 11 is prime. Thus 2 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range@ 153000,PrimeQ[#] && PrimeQ[10#-1] && PrimeQ[10#-3] && PrimeQ[10#-7] && PrimeQ[10#-9] &] (* Robert G. Wilson v, Jun 06 2014 *)
    Select[Prime[Range[15000]],AllTrue[10#-{1,3,7,9},PrimeQ]&] (* Harvey P. Dale, Aug 18 2024 *)
  • PARI
    for(n=1,10^5,if(ispseudoprime(10*prime(n)-1) && ispseudoprime(10*prime(n)-3) && ispseudoprime(10*prime(n)-7) && ispseudoprime(10*prime(n)-9),print1(prime(n),", ")))
  • Python
    import sympy
    from sympy import isprime
    from sympy import prime
    {print(prime(n),end=', ') for n in range(1,10**5) if isprime(10*prime(n)-1) and isprime(10*prime(n)-3) and isprime(10*prime(n)-7) and isprime(10*prime(n)-9)}
    
Showing 1-7 of 7 results.