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

A069686 Primes whose internal digits form a prime.

Original entry on oeis.org

127, 131, 137, 139, 151, 157, 173, 179, 223, 227, 229, 233, 239, 251, 257, 271, 277, 331, 337, 353, 359, 373, 379, 421, 431, 433, 439, 457, 479, 521, 523, 557, 571, 577, 631, 653, 659, 673, 677, 727, 733, 739, 751, 757, 773, 821, 823, 827, 829, 839, 853
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

Primes that remain prime upon deleting the first and last digits.

Crossrefs

Programs

  • Mathematica
    Select[Range[100, 853], PrimeQ[#] && PrimeQ[FromDigits[Rest[Most[IntegerDigits[#]]]]] &] (* T. D. Noe, Apr 05 2013 *)
  • PARI
    {indigs(n)=local(j,a,d); n=n\10; j=1; a=0; while(n>10,d=divrem(n,10); n=d[1]; a=a+j*d[2]; j=10*j); a}
    forprime(p=1,855,if(isprime(indigs(p)),print1(p,","))) \\ Klaus Brockhaus, Nov 06 2002
    
  • Python
    from sympy import isprime
    for p in filter(isprime, range(100, 855)):
        if isprime(int(str(p)[1:-1])): print(p) # Jason Yuen, Mar 28 2024

Extensions

Edited and extended by Klaus Brockhaus, Nov 06 2002
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 21 2007

A077359 Primes whose external digits form a prime. Or primes from which deleting the internal digits leaves a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 223, 229, 233, 239, 263, 269, 283, 293, 307, 311, 317, 331
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Crossrefs

Programs

  • Mathematica
    edpQ[n_]:=Module[{idn=IntegerDigits[n]},PrimeQ[10idn[[1]]+idn[[-1]]]]; Join[ {2,3,5,7},Select[Prime[Range[200]],edpQ]] (* Harvey P. Dale, Nov 20 2020 *)
  • PARI
    {exdigs(n)=local(a,j,d); d=divrem(n,10); a=d[2]; n=d[1]; j=1; while(n>10,d=divrem(n,10); n=d[1]; j=10*j); 10*n+a} forprime(p=1,335,if(isprime(exdigs(p)),print1(p,",")))

Extensions

Edited and extended by Klaus Brockhaus, Nov 06 2002

A077361 Smallest n-digit prime whose external digits as well as internal digits form a prime, or 0 if no such number exists.

Original entry on oeis.org

0, 0, 127, 1021, 10037, 100057, 1000033, 10000079, 100000037, 1000000021, 10000000033, 100000000057, 1000000000039, 10000000000037, 100000000000031, 1000000000000037, 10000000000000079, 100000000000000021
Offset: 0

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

Conjecture: no entry is zero for n>2.

Crossrefs

Programs

  • Mathematica
    eifpQ[n_]:=Module[{idn=IntegerDigits[n]},PrimeQ[FromDigits[{First[ idn], Last[ idn]}]]&&PrimeQ[FromDigits[Rest[Most[idn]]]]]; ndp[pwr_]: = Module[ {p=NextPrime[10^pwr]},While[!eifpQ[p],p=NextPrime[p]];p]; Join[ {0,0}, Table[ndp[i],{i,2,20}]] (* Harvey P. Dale, Jan 03 2015 *)

Extensions

More terms from Sascha Kurz, Jan 11 2003

A077362 Largest n-digit prime whose external digits as well as internal digits form a prime, or 0 if no such number exists.

Original entry on oeis.org

0, 0, 977, 9677, 99377, 998717, 9998777, 99999617, 999999017, 9999996437, 99999997397, 999999997277, 9999999986477, 99999999993317, 999999999997337, 9999999999990797, 99999999999998837, 999999999999995717, 9999999999999997397, 99999999999999994877
Offset: 0

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

Conjecture: no entry is zero for n>2.
Conjecture: each term after the first two terms ends with 7. - Harvey P. Dale, May 26 2018

Crossrefs

Programs

  • Mathematica
    LastDigit[n_] := n - 10*Floor[n/10]; FirstDigit[n_] := Floor[n/(10^(Ceiling[Log[10, n]] - 1))]; MiddleDigits[n_] := Floor[(n - Floor[n/(10^(Ceiling[Log[10, n]] - 1))]*10^(Ceiling[Log[10, n]] - 1))/10]; IntExtPrimeTest2[n_] := TrueQ[(Boole[PrimeQ[FirstDigit[n]*10 + LastDigit[ n]]] + Boole[PrimeQ[MiddleDigits[n]]] + Boole[PrimeQ[n]]) == 3]; finder[digits_] := (maxj = 10^digits; For[j = maxj, IntExtPrimeTest2[j] == False, j-- ]; j); Table[finder[n], {n, 3, 20}] (* Joshua Albert (jba138(AT)psu.edu), Feb 22 2006 *)
    eidQ[n_]:=Module[{idn=IntegerDigits[n]},AllTrue[{FromDigits[Join[ {idn[[1]]}, {idn[[-1]]}]],FromDigits[Most[Rest[idn]]]},PrimeQ]]; Join[ {0,0},Table[Module[{np=NextPrime[10^n-1,-1]},While[ !eidQ[np],np = NextPrime[ np,-1]];np],{n,3,18}]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 26 2018 *)

Extensions

Corrected and extended by Joshua Albert (jba138(AT)psu.edu), Feb 22 2006
Showing 1-4 of 4 results.