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-3 of 3 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

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

Showing 1-3 of 3 results.