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.

Previous Showing 11-20 of 22 results. Next

A217062 Primes that remain prime when a single "9" digit is inserted between any two adjacent digits.

Original entry on oeis.org

11, 13, 17, 19, 23, 37, 41, 53, 59, 61, 97, 101, 107, 113, 149, 193, 197, 199, 227, 239, 263, 269, 271, 311, 331, 367, 409, 431, 443, 457, 499, 587, 617, 659, 661, 691, 727, 733, 751, 823, 863, 941, 967, 1009, 1423, 1571, 1709, 1759, 1973, 1993, 1997, 2063, 2137
Offset: 1

Views

Author

Paolo P. Lava, Sep 26 2012

Keywords

Examples

			214883 is prime and also 2148893, 2148983, 2149883, 2194883 and 2914883.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    A217062:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 5 to q do
      a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
        for i from 1 to b-1 do
          c:=a+9*10^i*trunc(a/10^i)+10^i*x;  if not isprime(c) then ok:=0; break; fi; od;
        if ok=1 then print(ithprime(n)); fi; od; end:
    A217062(1000000,9);
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=9; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012

A217065 Primes that remain prime when a single "7" digit is inserted between any two adjacent digits.

Original entry on oeis.org

13, 19, 67, 73, 97, 277, 367, 379, 421, 433, 487, 541, 691, 757, 853, 967, 1117, 1471, 1747, 2017, 2617, 2749, 2851, 2953, 3463, 3529, 3571, 4507, 5077, 5923, 6073, 6079, 6343, 6481, 6577, 6709, 6829, 6967, 7351, 7417, 7573, 7681, 8317, 8719, 9157, 9649, 13177
Offset: 1

Views

Author

Paolo P. Lava, Sep 26 2012

Keywords

Examples

			311683 is prime and also 3116873, 3116783, 3117683, 3171683 and 3711683.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    A217065:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 5 to q do
      a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
        for i from 1 to b-1 do
          c:=a+9*10^i*trunc(a/10^i)+10^i*x;  if not isprime(c) then ok:=0; break; fi; od;
        if ok=1 then print(ithprime(n)); fi; od; end:
    A217065(1000000,7);
  • Mathematica
    Select[Prime[Range[5,1600]],AllTrue[FromDigits/@Table[Insert[ IntegerDigits[ #],7,i],{i,2,IntegerLength[#]}],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 12 2016 *)
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=7; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012

A050715 Inserting a digit '5' between adjacent digits of n makes a prime.

Original entry on oeis.org

11, 17, 21, 27, 33, 39, 47, 57, 63, 69, 71, 77, 83, 87, 89, 93, 103, 129, 139, 141, 151, 159, 189, 199, 207, 213, 223, 237, 243, 247, 267, 279, 291, 301, 303, 309, 313, 319, 321, 327, 333, 373, 379, 381, 391, 403, 429, 453, 457, 469, 471, 477, 483, 493, 499
Offset: 1

Views

Author

Patrick De Geest, Aug 15 1999

Keywords

Examples

			373 becomes 3(5)7(5)3 which is prime 35753.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10,500],PrimeQ[FromDigits[Riffle[IntegerDigits[#],5]]]&] (* Harvey P. Dale, Apr 07 2018 *)

Extensions

Offset changed to 1 by Georg Fischer, Oct 15 2019

A217045 Primes that remain prime when a single "4" digit is inserted between any two adjacent decimal digits.

Original entry on oeis.org

19, 37, 43, 61, 67, 73, 97, 109, 199, 211, 223, 241, 349, 409, 421, 457, 463, 541, 571, 751, 757, 823, 991, 1033, 1087, 1321, 1423, 1447, 1543, 2749, 3361, 3469, 3499, 3847, 4111, 4273, 4483, 5059, 5437, 5443, 5449, 6373, 6709, 6793, 7687, 8089, 8221, 8443
Offset: 1

Views

Author

Paolo P. Lava, Sep 25 2012

Keywords

Examples

			87697 is prime and also 876947, 876497, 874697 and 847697.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    A217045:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 5 to q do
    a:=ithprime(n); b:=0;
    while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
      for i from 1 to b-1 do
        c:=a+9*10^i*trunc(a/10^i)+10^i*x;
        if not isprime(c) then ok:=0; break; fi; od;
      if ok=1 then print(ithprime(n)); fi;
    od; end:
    A217045(100000,4)
  • Mathematica
    Select[Prime[Range[5,1500]],AllTrue[Table[FromDigits[Insert[ IntegerDigits[ #],4,n]],{n,2,IntegerLength[#]}],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 04 2017 *)
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=4; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012

A217046 Primes that remain prime when a single "6" digit is inserted between any two adjacent decimal digits.

Original entry on oeis.org

13, 17, 23, 29, 37, 41, 43, 47, 53, 59, 61, 71, 79, 83, 97, 101, 109, 113, 137, 157, 163, 167, 263, 277, 293, 307, 313, 317, 331, 397, 421, 443, 457, 463, 569, 607, 653, 659, 661, 673, 691, 739, 769, 787, 809, 823, 829, 863, 881, 977, 997, 1063, 1087, 1453
Offset: 1

Views

Author

Paolo P. Lava, Sep 25 2012

Keywords

Examples

			185917 is prime and also 1859167, 1859617, 1856917, 1865917 and 1685917.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    A217044:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 5 to q do
    a:=ithprime(n); b:=0;
    while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
      for i from 1 to b-1 do
        c:=a+9*10^i*trunc(a/10^i)+10^i*x;
        if not isprime(c) then ok:=0; break; fi; od;
      if ok=1 then print(ithprime(n)); fi;
    od; end:
    A217044(100000,6)
  • Mathematica
    Select[Prime[Range[5,1200]],And@@PrimeQ[FromDigits/@Table[ Insert[ IntegerDigits[ #],6,i],{i,2,IntegerLength[#]}]]&] (* Harvey P. Dale, Oct 09 2012 *)
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=6; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012

A217063 Primes that remain prime when a single "3" digit is inserted between any two adjacent decimal digits.

Original entry on oeis.org

11, 17, 19, 23, 29, 31, 37, 41, 43, 61, 73, 79, 89, 97, 101, 103, 127, 167, 173, 181, 211, 233, 239, 251, 271, 283, 307, 331, 359, 373, 439, 491, 509, 523, 547, 599, 673, 709, 733, 769, 877, 887, 937, 941, 991, 1033, 1229, 1381, 1619, 1721, 1759, 1789, 1901
Offset: 1

Views

Author

Paolo P. Lava, Sep 26 2012

Keywords

Examples

			212881 is prime and also 2128831, 2128381, 2123881, 213288 and 2312881.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesInInterval(11, 2000) | forall{m: t in [1..#Intseq(p)-1] | IsPrime(m) where m is (Floor(p/10^t)*10+3)*10^t+p mod 10^t}]; // Bruno Berselli, Sep 26 2012
    
  • Maple
    with(numtheory);
    A217063:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 5 to q do
      a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
        for i from 1 to b-1 do
          c:=a+9*10^i*trunc(a/10^i)+10^i*x;  if not isprime(c) then ok:=0; break; fi; od;
        if ok=1 then print(ithprime(n)); fi; od; end:
    A217063(1000000,3);
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=3; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012
    
  • Python
    from sympy import isprime, primerange
    def ok(p):
        if p < 10: return False
        s = str(p)
        return all(isprime(int(s[:i] + "3" + s[i:])) for i in range(1, len(s)))
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(1901)) # Michael S. Branicky, Nov 17 2021

A050805 Inserting any digit between adjacent digits of prime p never yields another prime.

Original entry on oeis.org

439, 853, 1013, 1061, 1109, 1117, 1153, 1187, 1213, 1249, 1259, 1283, 1291, 1301, 1303, 1361, 1427, 1451, 1489, 1511, 1523, 1531, 1583, 1597, 1607, 1657, 1733, 1747, 1753, 1801, 1873, 1879, 1913, 1951, 2069, 2083, 2137, 2243, 2251, 2267, 2293, 2297
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Examples

			40309, 41319, 42327, 43339, 44349, 45359, 46369, 47379, 48389, and 49399 are all composite. Thus, 439, being prime, belongs to the sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (intersperse)
    a050805 n = a050805_list !! (n-1)
    a050805_list = filter ((all (== 0)) . f) a000040_list where
       f p = map (i $ show p) "0123456789"
       i ps d = a010051' (read $ intersperse d ps :: Integer)
    -- Reinhard Zumkeller, May 07 2013
  • Mathematica
    a[n_]:=Or@@PrimeQ[Table[FromDigits[Riffle[IntegerDigits[n],k]],{k,0,9}]]; Select[Prime[Range[5,350]],a[#]==False&] (* Jayanta Basu, May 30 2013 *)
    Select[Prime[Range[400]],NoneTrue[Table[FromDigits[Riffle[ IntegerDigits[ #],d]],{d,0,9}],PrimeQ]&] (* Harvey P. Dale, Aug 04 2021 *)

Extensions

Offset corrected by Reinhard Zumkeller, May 07 2013

A050806 Inserting any digit between adjacent digits of prime p produces exactly 1 new prime.

Original entry on oeis.org

101, 149, 163, 241, 269, 271, 317, 347, 367, 397, 409, 419, 443, 487, 509, 541, 587, 601, 641, 761, 787, 811, 821, 863, 907, 919, 1439, 1481, 1663, 1877, 2089, 2111, 2579, 2593, 2671, 2819, 2971, 3121, 3457, 3463, 3571, 3643, 3659, 3769, 3917, 4001
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Examples

			101 yields only one prime using digit '6' -> 1(6)0(6)1 -> prime 16061.
		

Crossrefs

Programs

  • Haskell
    import Data.List (intersperse)
    a050806 n = a050806_list !! (n-1)
    a050806_list = filter ((== 1) . sum . f) a000040_list where
       f p = map (i $ show p) "0123456789"
       i ps d = a010051' (read $ intersperse d ps :: Integer)
    -- Reinhard Zumkeller, May 07 2013
  • Mathematica
    aQ[n_]:=Plus@@Boole[PrimeQ[Table[FromDigits[Riffle[IntegerDigits[n],k]],{k,0,9}]]]==1; Select[Prime[Range[5,555]],aQ[#]&] (* Jayanta Basu, May 30 2013 *)

Extensions

Offset corrected by Reinhard Zumkeller, May 07 2013

A217064 Primes that remain prime when a single "5" digit is inserted between any two adjacent decimal digits.

Original entry on oeis.org

11, 17, 47, 71, 83, 89, 149, 167, 179, 251, 257, 293, 347, 359, 383, 419, 461, 467, 491, 557, 563, 569, 653, 773, 911, 1193, 1217, 1277, 1451, 1559, 1667, 1823, 1901, 2243, 2309, 2357, 2579, 2657, 2999, 3527, 3533, 4289, 5051, 5351, 5501, 5843, 6089, 6551, 6581
Offset: 1

Views

Author

Paolo P. Lava, Sep 26 2012

Keywords

Examples

			290183 is prime and also 2901853, 2901583, 2905183, 2950183 and 2590183.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    A217064:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 5 to q do
      a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
        for i from 1 to b-1 do
          c:=a+9*10^i*trunc(a/10^i)+10^i*x;  if not isprime(c) then ok:=0; break; fi; od;
        if ok=1 then print(ithprime(n)); fi; od; end:
    A217064(1000000,5);
  • Mathematica
    Select[Prime[Range[5,1000]],AllTrue[FromDigits/@Table[ Insert[ IntegerDigits[ #],5,n],{n,2,IntegerLength[#]}],PrimeQ]&] (* Harvey P. Dale, Feb 20 2022 *)
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=5; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012

A133321 Inserting any (identical) digit between adjacent digits of an odd semiprime k never yields a prime.

Original entry on oeis.org

15, 25, 35, 55, 65, 85, 95, 115, 121, 143, 145, 155, 185, 187, 205, 215, 235, 253, 265, 295, 299, 305, 335, 341, 355, 365, 393, 395, 411, 415, 437, 445, 451, 473, 485, 505, 515, 535, 545, 565, 583, 635, 655, 671, 679, 685, 695, 717, 745, 755, 781, 785, 815
Offset: 1

Views

Author

Jonathan Vos Post, Oct 18 2007

Keywords

Comments

Odd semiprime analog of A050805. Trivially true for any digit if we substitute "even semiprime" for "odd semiprime." Trivially true for any semiprime which is a multiple of 5 (A001750). The nonmultiples of 5 in this sequence begin 121, 143, 187, 253, 299, 341.

Examples

			121 is in the sequence because 10201, 11211, 12221, 13231, 14241, 15251, 16261, 17271, 18281, 19291 are all composite.
		

Crossrefs

Programs

  • Mathematica
    Select[Select[Range[11,900,2],PrimeOmega[#]==2&],AllTrue[Table[ FromDigits[ Riffle[ IntegerDigits[#],n]],{n,0,9}],CompositeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 07 2018 *)

Extensions

More terms from R. J. Mathar, Oct 22 2007
Previous Showing 11-20 of 22 results. Next