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

A077360 Primes whose external digits as well as internal digits form a prime.

Original entry on oeis.org

127, 131, 137, 139, 151, 157, 173, 179, 223, 229, 233, 239, 331, 337, 421, 431, 433, 457, 523, 631, 677, 733, 739, 751, 773, 823, 829, 839, 853, 859, 937, 977, 1021, 1031, 1033, 1039, 1051, 1117, 1171, 1193, 1231, 1237, 1291, 1297, 1319, 1373, 1433, 1439
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

Intersection of A069686 and A077359.

Examples

			139 is a term as 19 and 3 are both primes.
		

Crossrefs

Programs

  • PARI
    forprime(p=1,1440,if(isprime(indigs(p))&&isprime(exdigs(p)),print1(p,",")))
    
  • Python
    from sympy import isprime, primerange
    for p in primerange(100, 1440):
        if isprime(int(str(p)[1:-1])) and isprime(int(str(p)[0]+str(p)[-1])):
            print(p)  # Jason Yuen, Apr 21 2024

Extensions

Edited and extended by Klaus Brockhaus, Nov 06 2002

A225082 Centrally deletable primes.

Original entry on oeis.org

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, 337, 347, 367, 397, 401, 421, 431, 433, 443, 457, 461, 463, 467, 487, 491, 503, 509, 523, 563
Offset: 1

Views

Author

Keywords

Comments

Prime numbers that remain primes when their central digit is (or two central digits are) deleted.
At the 1886th prime number (16229), there are exactly 943 centrally deletable primes, and 943 that become composites. It appears that there are always more non-deletable primes thereafter.
Subset of A080603 and of A077359.

Examples

			a(5) = 1(1)3, and 13 is a prime.
		

Crossrefs

Programs

  • Mathematica
    dcd[n_] := Block[{d = IntegerDigits@n, z}, z = Length@d; FromDigits@ Delete[d, Floor[(z + {{1}, {2}})/2]]]; Select[Prime@ Range@ 103, PrimeQ@ dcd@ # &] (* Giovanni Resta, Apr 29 2013 *)
  • R
    library(gmp)
    sumsubstrpow<-function(n) {
    no0<-function(s){ while(substr(s,1,1)=="0" && nchar(s)>1) s=substr(s,2,nchar(s)); s}
    tot=as.bigz(0); s=as.character(n); len=nchar(s)
    for(i in 1:len) for(j in i:len) tot=tot+as.bigz(no0(substr(s,i,j)))^(j-i+1)
    tot
    }
    #recursive
    n=as.bigz(10); for(y in 1:4) n[y+1]=sumsubstrpow(n[y])

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