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

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

Original entry on oeis.org

17, 23, 29, 41, 53, 83, 89, 101, 113, 131, 137, 149, 251, 359, 401, 419, 443, 461, 647, 719, 797, 821, 863, 941, 1289, 1823, 2111, 2543, 3323, 3413, 4013, 4463, 4751, 5021, 5501, 5807, 6299, 6827, 7229, 7643, 7883, 8039, 8219, 8609, 8837, 9221, 9227, 9461, 9623
Offset: 1

Views

Author

Paolo P. Lava, Sep 25 2012

Keywords

Examples

			9461 is prime and also 94621, 94261, 92461.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesInInterval(11, 10000) | forall{m: t in [1..#Intseq(p)-1] | IsPrime(m) where m is (Floor(p/10^t)*10+2)*10^t+p mod 10^t}]; // Bruno Berselli, Sep 26 2012
    
  • 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,2)
  • Mathematica
    Select[Prime[Range[5,1200]],And@@PrimeQ[FromDigits/@Table[ Insert[ IntegerDigits[ #],2,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]=2; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n)  \\ Charles R Greathouse IV, Sep 26 2012

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

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

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

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

Original entry on oeis.org

13, 31, 37, 67, 79, 103, 109, 151, 163, 181, 193, 211, 241, 367, 457, 547, 571, 601, 613, 631, 709, 787, 811, 1117, 1213, 1831, 2017, 2683, 3019, 3319, 3391, 3511, 3517, 3607, 4519, 4999, 6007, 6121, 6151, 6379, 6673, 6871, 6991, 8293, 11119, 11317, 11467
Offset: 1

Views

Author

Michael S. Branicky, Nov 23 2021

Keywords

Examples

			37 and 317 are prime; 2683 is prime, as are 21683, 26183, and 26813.
		

Crossrefs

The terms of A069246 > 10 are a subsequence.
Cf. A215417 (same with 0), A217044 (2), A217045 (4), A217046 (6), A217047 (8), A217062 (9), A217063 (3), A217064 (5), A217065 (7).
Subsequence of A002476.

Programs

  • Mathematica
    Select[Prime@Range[5,1500],(p=#;And@@PrimeQ[FromDigits/@(Insert[IntegerDigits@p,1,#]&/@Range[2,IntegerLength@p])])&] (* Giorgos Kalogeropoulos, Nov 23 2021 *)
  • Python
    from sympy import isprime, primerange
    def ok(p):
        if p < 10: return False
        s = str(p)
        return all(isprime(int(s[:i] + "1" + 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(12000)) # Michael S. Branicky, Nov 23 2021
Showing 1-8 of 8 results.