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

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

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