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

A069687 Primes that yield another prime on placing a 1 on both sides (as leading and trailing digits).

Original entry on oeis.org

3, 5, 17, 23, 29, 47, 53, 83, 107, 113, 131, 149, 173, 197, 239, 251, 317, 359, 383, 401, 443, 503, 509, 599, 641, 683, 701, 719, 743, 797, 821, 947, 953, 1031, 1049, 1103, 1109, 1187, 1229, 1277, 1283, 1301, 1373, 1583, 1613, 1619, 1637, 1733, 1847, 1889
Offset: 1

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Examples

			239 belongs to this sequence as 12391 is also a prime.
947 and 19471 are both primes ==> 947 is in the sequence. [From _José María Grau Ribas_, Jan 22 2012]
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local p;
          p:= `if`(n=1, 1, a(n-1));
          do p:= nextprime(p);
             if isprime(parse(cat(1, p, 1))) then break fi
          od; p
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, May 18 2012
  • Mathematica
    Select[ Range[2000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 1, {{1}, {-1}}]]] &]
    san[i_]:=1+Prime[i]*10+10^(Floor@Log[10,Prime[i]]+2); Prime@Select[Range[1000],PrimeQ@san[#]&]  (* From José María Grau Ribas, Jan 22 2012 *)
    Select[Prime[Range[300]],PrimeQ[FromDigits[Join[{1},IntegerDigits[#],{1}]]]&]  (* Harvey P. Dale, May 18 2012 *)
  • PARI
    forprime( p=1,9999, isprime(10^#Str(p*10)+p*10+1) & print1(p",")) \\ M. F. Hasler, May 18 2012
    
  • PARI
    A069687_vec(Nmax=10^4)=my(p,d=1);vector(Nmax,i,until(isprime((d+p)*10+1), d<(p=nextprime(p+1))&d*=10);p)  \\ M. F. Hasler, May 19 2012

Extensions

Edited and extended by Robert G. Wilson v, May 03 2002
Corrected and edited following suggestions by H. P. Dale and others by M. F. Hasler, May 18 2012

A069688 Primes that yield another prime on placing a 3 on both sides (as leading and trailing digits).

Original entry on oeis.org

5, 7, 31, 37, 41, 43, 53, 59, 61, 67, 73, 79, 83, 101, 103, 139, 151, 157, 179, 197, 223, 241, 257, 263, 269, 271, 283, 293, 307, 311, 349, 353, 389, 421, 431, 461, 467, 491, 557, 593, 599, 601, 607, 631, 643, 647, 683, 691, 701, 727, 757, 769, 811, 827, 839
Offset: 1

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Examples

			139 is a member as 31393 is also a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range[1000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 3, {{1}, {-1}}]]] &]
    Select[Prime[Range[200]],PrimeQ[FromDigits[Join[{3},IntegerDigits[#],{3}]]]&] (* Harvey P. Dale, Oct 24 2011 *)

Extensions

Edited and extended by Robert G. Wilson v, May 03 2002

A069690 Primes that yield another prime on placing a 9 on both sides (as leading and trailing digits).

Original entry on oeis.org

2, 19, 23, 31, 41, 43, 47, 53, 61, 67, 71, 73, 83, 101, 107, 109, 113, 149, 163, 193, 211, 239, 241, 263, 269, 277, 313, 317, 331, 347, 373, 397, 409, 421, 439, 443, 499, 521, 523, 541, 547, 607, 617, 619, 641, 647, 673, 677, 757, 787, 829, 863, 877, 907, 911
Offset: 1

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Examples

			241 belongs to this sequence as 92419 is also a prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) isprime(9+10*n+9*10^(2+ilog10(n))) end proc:
    select(filter, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Feb 02 2021
  • Mathematica
    Select[ Range[2000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 9, {{1}, {-1}}]]] &]
    Select[Prime[Range[200]],PrimeQ[FromDigits[Join[{9},IntegerDigits[#],{9}]]]&] (* Harvey P. Dale, Nov 07 2022 *)
  • Python
    from sympy import isprime, primerange
    def ok(p): return isprime(int('9'+str(p)+'9'))
    def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
    print(aupto(911)) # Michael S. Branicky, Feb 19 2021

Extensions

Edited and extended by Robert G. Wilson v, May 03 2002

A059694 Primes p such that 1p1, 3p3, 7p7 and 9p9 are all primes.

Original entry on oeis.org

53, 2477, 4547, 5009, 7499, 8831, 9839, 11027, 24821, 26393, 29921, 36833, 46073, 46769, 47711, 49307, 53069, 59621, 64283, 66041, 79901, 84017, 93263, 115679, 133103, 151121, 169523, 197651, 207017, 236807, 239231, 255191, 259949, 265271, 270071, 300431, 330047
Offset: 1

Views

Author

Patrick De Geest, Feb 07 2001

Keywords

Comments

All terms == 1 (mod 6). The sequence is apparently infinite. There are 16486 terms up to 10^9. - Zak Seidov, Jan 17 2014
Intersection of A069687, A069688, A069689, and A069690. - Zak Seidov, Jan 17 2014

Examples

			53 is a term because 1531, 3533, 7537 and 9539 are primes.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if all(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 23 2023

A341017 Primes p such that placing digit i at both ends of p produces another prime for at least two of i = [1,3,7, 9].

Original entry on oeis.org

2, 5, 17, 23, 29, 31, 41, 43, 47, 53, 61, 67, 71, 73, 83, 101, 107, 113, 131, 149, 197, 239, 241, 257, 263, 269, 293, 317, 347, 359, 389, 401, 421, 431, 443, 503, 521, 557, 593, 599, 607, 641, 647, 677, 683, 701, 757, 797, 827, 887, 911, 953, 1031, 1103, 1109, 1117, 1171, 1181, 1187, 1223, 1277
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Feb 02 2021

Keywords

Comments

Numbers that are in at least two of A069687, A069688, A069689 and A069690.

Examples

			a(3) = 17 is a term because 17 is in A069687 and A069689, i.e. 1171 and 7177 are prime.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local i; isprime(n) and numboccur(true,[seq(isprime(i+10*n+i*10^(2+ilog10(n))),i=[1,3,7,9])]) >= 2 end proc:
    select(filter, [2,seq(i,i=3..1000)]);
  • Python
    from sympy import isprime, nextprime
    def ok(p): return sum(isprime(int(c+str(p)+c)) for c in "1379") >= 2
    def aupto(limit): # only test primes
      alst, p = [], 2
      while p <= limit:
        if ok(p): alst.append(p)
        p = nextprime(p)
      return alst
    print(aupto(1277)) #Michael S. Branicky, Feb 02 2021

A360781 Primes p such that at least one number remains prime when p is bracketed by a single digit d; that is, at least one instance of d//p//d is prime where // means concatenation.

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 101, 103, 107, 109, 113, 131, 139, 149, 151, 157, 163, 173, 179, 191, 193, 197, 211, 223, 227, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
Offset: 1

Views

Author

Harvey P. Dale, Feb 20 2023

Keywords

Comments

The bracketing digit d must be 1, 3, 7, or 9.

Examples

			263 is included because 263 is a prime and 32633 (and also 92639) is a prime.
		

Crossrefs

Programs

  • Maple
    q:= p-> ormap(isprime, map(d-> parse(cat(d, p, d)), [1, 3, 7, 9])):
    select(q, [ithprime(i)$i=1..67])[];  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    brkQ[p_]:=AnyTrue[Table[FromDigits[Join[{d},IntegerDigits[p],{d}]],{d,{1,3,7,9}}],PrimeQ]; Select[Prime[Range[100]],brkQ]
  • PARI
    is(p) = my(d=digits(p)); forstep(k=1, 9, 2, if (isprime(fromdigits(concat(k, concat(d,k)))), return(1)));
    isok(p) = if (isprime(p), is(p)); \\ Michel Marcus, Feb 20 2023
  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if any(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 57))) # Michael S. Branicky, Feb 20 2023
    

Formula

Union of A069687, A069688, A069689, A069690. - Alois P. Heinz, Feb 22 2023
Showing 1-6 of 6 results.