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-10 of 11 results. Next

A077358 Duplicate of A069686.

Original entry on oeis.org

127, 131, 137, 139, 151, 157, 173, 179, 223, 227, 229, 233, 239, 251, 257, 271, 277
Offset: 1

Views

Author

Keywords

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

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

A225235 Emirps whose internal digits are also an emirp.

Original entry on oeis.org

1979, 3319, 3371, 3373, 3719, 3733, 7177, 7717, 9133, 9173, 9791, 10177, 10711, 10739, 11071, 11497, 11579, 11677, 13477, 13591, 13597, 17011, 17393, 17519, 19531, 19913, 30139, 30319, 30971, 31139, 31799, 31991, 37619, 39371, 39419, 39839, 70313, 70373, 70717
Offset: 1

Views

Author

Keywords

Comments

This sequence (like the emirps) experiences large gaps when the most-significant-digit is {2,4,5,6,8}.

Examples

			7177 and 10177 are in the sequence because both are emirps, and both become the emirp 17 upon deletion of their first and last digits.
		

Crossrefs

Programs

  • R
    library(gmp); isemirp<-function(x) isprime(x) & (j=paste(rev(unlist(strsplit(as.character(x), split=""))), collapse=""))!=x & isprime(j);
    no0<-function(s){ while(substr(s,1,1)=="0" & nchar(s)>1) s=substr(s,2,nchar(s)); s};
    i=as.bigz(0); y=as.bigz(rep(0, 100)); len=0;
    while(len<100) if(isemirp((i=nextprime(i)))) if(isemirp(as.bigz(no0(substr(i,2,nchar(as.character(i))-1))))) y[(len=len+1)]=i;
    as.vector(y)

A235687 Semiprimes which remain semiprimes when the rightmost digit is removed.

Original entry on oeis.org

46, 49, 62, 65, 69, 91, 93, 94, 95, 106, 141, 142, 143, 145, 146, 155, 158, 159, 213, 214, 215, 217, 218, 219, 221, 226, 253, 254, 259, 262, 265, 267, 334, 335, 339, 341, 346, 355, 358, 381, 382, 386, 391, 393, 394, 395, 398, 466, 469, 493, 497, 511, 514
Offset: 1

Views

Author

Colin Barker, Jan 14 2014

Keywords

Examples

			514 is in the sequence because 51 = 3*17.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[600],PrimeOmega[#]==2==PrimeOmega[FromDigits[ Most[ IntegerDigits[ #]]]]&] (* Harvey P. Dale, Oct 02 2014 *)
    Select[Range[600],PrimeOmega[#]==PrimeOmega[Quotient[#,10]]==2&] (* Harvey P. Dale, Mar 18 2023 *)
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    issemiprime(n) = n>0 && bigomega(n)==2
    t=list(1000); for(n=1, #t, if(issemiprime(t[n]\10), print1(t[n],", ")))

A235688 Semiprimes which remain semiprimes when the leftmost digit is removed.

Original entry on oeis.org

14, 26, 34, 39, 46, 49, 69, 74, 86, 94, 106, 115, 121, 122, 133, 134, 146, 155, 158, 169, 177, 185, 187, 194, 206, 209, 214, 215, 221, 226, 235, 249, 262, 265, 274, 287, 291, 295, 309, 314, 321, 326, 334, 335, 339, 346, 355, 358, 362, 365, 377, 382, 386, 391
Offset: 1

Views

Author

Colin Barker, Jan 14 2014

Keywords

Examples

			249 is in the sequence because 49 = 7*7.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[400],PrimeOmega[#]==PrimeOmega[Mod[#,10^(IntegerLength[ #]-1)]] == 2&] (* Harvey P. Dale, Jun 07 2017 *)
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    delleft(a) = my(b, c); b=#Str(a); c=a\(10^(b-1)); a-c*(10^(b-1))
    issemiprime(n) = n>0 && bigomega(n)==2
    t=list(500); for(n=1, #t, if(issemiprime(delleft(t[n])), print1(t[n],", ")))

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

A224953 Number of ways a digit can be appended or prepended to n and form a prime.

Original entry on oeis.org

4, 9, 3, 9, 3, 3, 2, 9, 2, 6, 4, 6, 1, 7, 1, 2, 2, 5, 1, 9, 0, 4, 3, 6, 1, 2, 2, 6, 2, 5, 1, 8, 0, 5, 2, 2, 1, 6, 2, 6, 2, 6, 1, 7, 2, 1, 3, 6, 1, 5, 2, 3, 2, 5, 2, 1, 2, 8, 1, 6, 2, 7, 0, 6, 3, 2, 1, 7, 1, 4, 2, 5, 1, 7, 1, 2, 2, 6, 1, 5, 1, 4, 4, 7, 0, 3, 1
Offset: 0

Views

Author

Keywords

Comments

The prime number may be formed by adding a digit either before or after n, though only odd numbers can become prime by having digits added before n.
Appending a zero before n produces a prime if and only if n is prime. Conversely, for all prime numbers p, a(p) > 0.
In theory, a maximum of 7 digits could be added before any n, and 3 of the odd digits after n in cases where [10*n, 10*n+9] contains a number that is a factor of 3, 5 and 7 (the three single-digit odd primes). In practice, it appears that all 10 possibilities are never realized. There are 9 possibilities for n = {1, 3, 7, 19}.
The only example of a prime being formed two different ways is for n = 1, which can become 11 if a 1 is appended to either the front or the back. These are naively counted as two distinct alternatives. [This would also be true for n = A002275(A004023(k) - 1) for k > 1 as appending a 1 to either the front or the back forms the k-th repunit prime. - Michael S. Branicky, May 22 2024]
The term a(29587) is the first occurrence of 10. The primes are 29587, 129587, 329587, 429587, 729587, 929587, 295871, 295873, 295877, and 295879. This is the only occurrence of 10 for n < 10^8. - T. D. Noe, Apr 21 2013

Examples

			a(0) = 4 because there are 4 ways to concatenate a digit to 0 to produce a prime number: 02, 03, 05, and 07.
a(3) = 9 because a digit can be concatenated to 3 in 9 ways to produce a prime number: 03, 13, 23, 43, 53, 73, 83, 31, and 37.
		

Crossrefs

Cf. A069686.
Cf. A075595.
Index of zeros in this sequence: A124665.

Programs

  • Mathematica
    Table[num = IntegerDigits[n]; cnt = 0; Do[If[PrimeQ[FromDigits[Prepend[num, k]]], cnt++], {k, 0, 9}]; Do[If[PrimeQ[FromDigits[Append[num, k]]], cnt++], {k, 0, 9}]; cnt, {n, 0, 86}] (* T. D. Noe, Apr 20 2013 *)
  • R
    sapply(1:100, function(x) sum(sapply(as.numeric(c(paste0(0:9,x), paste0(x,c(1,3,7,9)))), is_prime  ))) # Christian N. K. Anderson, Apr 30 2024

A235689 Semiprimes which remain semiprimes when the leftmost and rightmost digits are removed.

Original entry on oeis.org

141, 142, 143, 145, 146, 161, 166, 169, 194, 247, 249, 262, 265, 267, 291, 295, 298, 299, 341, 346, 361, 362, 365, 391, 393, 394, 395, 398, 445, 446, 447, 466, 469, 493, 497, 542, 543, 545, 562, 565, 566, 591, 597, 649, 662, 667, 669, 694, 695, 697, 698, 699
Offset: 1

Views

Author

Colin Barker, Jan 14 2014

Keywords

Examples

			169 = 13^2 is in the sequence because 6 = 2*3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100,700],PrimeOmega[#]==PrimeOmega[FromDigits[ Rest[ Most[ IntegerDigits[ #]]]]] ==2&] (* Harvey P. Dale, Nov 22 2018 *)
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    delleft(a) = my(b, c); b=#Str(a); c=a\(10^(b-1)); a-c*(10^(b-1))
    issemiprime(n) = n>0 && bigomega(n)==2
    t=list(700); for(n=1, #t, if(issemiprime(delleft(t[n]\10)), print1(t[n],", ")))
Showing 1-10 of 11 results. Next