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

A216169 Composite numbers > 9 which yield a prime whenever a 0 is inserted between any two digits.

Original entry on oeis.org

49, 119, 121, 133, 161, 169, 203, 253, 299, 301, 319, 323, 403, 407, 473, 493, 511, 539, 551, 581, 611, 667, 679, 713, 869, 901, 913, 943, 1007, 1067, 1079, 1099, 1211, 1273, 1691, 1729, 1799, 1909, 2021, 2047, 2101, 2117, 2359, 2407, 2533, 2717, 2759, 2899
Offset: 1

Views

Author

Paolo P. Lava, Sep 03 2012

Keywords

Examples

			2359 is not prime but 23509, 23059 and 20359 are all primes.
		

Crossrefs

Subset of composite numbers in A164329. - M. F. Hasler, May 10 2018

Programs

  • Maple
    A216169:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 10 to q do
    if not isprime(n) then
      a:=n; b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=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(n); fi;
    fi; od; end: A216169(1000,0);
  • Mathematica
    Select[Range[10,3000],CompositeQ[#]&&AllTrue[Table[FromDigits[ Insert[ IntegerDigits[ #],0,n]],{n,2,IntegerLength[#]}],PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 13 2018 *)
  • PARI
    is(n, L=logint(n+!n, 10)+1, P)={!isprime(n) && !for(k=1, L-1, isprime([10*P=10^(L-k),1]*divrem(n, P))||return) && n>9} \\ M. F. Hasler, May 10 2018

Extensions

Name edited by M. F. Hasler, May 10 2018

A216166 Composite numbers and 1 which yield a prime whenever a 3 is inserted anywhere in them (including at the beginning or end).

Original entry on oeis.org

1, 121, 343, 361, 533, 637, 793, 889, 943, 1183, 3013, 3223, 3353, 3403, 3757, 3827, 3893, 4313, 4543, 4963, 8653, 10423, 14257, 20339, 23083, 23419, 30917, 33031, 33101, 33323, 33433, 33701, 33821, 34333, 34393, 35453, 36437, 36533, 39137, 39247, 42869, 43337
Offset: 1

Views

Author

Paolo P. Lava, Sep 03 2012

Keywords

Examples

			3827 is not prime but 38273, 38237, 38327 and 33827 are all primes.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..50000] | not IsPrime(n) and forall{m: t in [0..#Intseq(n)] | IsPrime(m) where m is (Floor(n/10^t)*10+3)*10^t+n mod 10^t}]; // Bruno Berselli, Sep 03 2012
  • Maple
    with(numtheory);
    A216166:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 1 to q do
    if not isprime(n) then
      a:=n; b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=n; ok:=1;
      for i from 0 to b 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(n); fi;
    fi;
    od; end:
    A216166(1000,3);
  • Mathematica
    ap3Q[n_]:=CompositeQ[n]&&AllTrue[FromDigits/@Table[Insert[ IntegerDigits[ n],3,k],{k,IntegerLength[n]+1}],PrimeQ]; Join[{1},Select[Range[ 44000], ap3Q]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 25 2020 *)

A216167 Composite numbers which yield a prime whenever a 5 is inserted anywhere in them, excluding at the end.

Original entry on oeis.org

9, 21, 57, 63, 69, 77, 87, 93, 153, 231, 381, 407, 413, 417, 501, 531, 581, 651, 669, 741, 749, 783, 791, 987, 1241, 1551, 1797, 1971, 2189, 2981, 3381, 3419, 3591, 3951, 4083, 4503, 4833, 4949, 4959, 5049, 5117, 5201, 5229, 5243, 5529, 5547, 5603, 5691, 5697
Offset: 1

Views

Author

Paolo P. Lava, Sep 03 2012

Keywords

Examples

			4083 is not prime but 40853, 40583, 45083 and 54083 are all primes.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..6000] | not IsPrime(n) and forall{m: t in [1..#Intseq(n)] | IsPrime(m) where m is (Floor(n/10^t)*10+5)*10^t+n mod 10^t}]; // Bruno Berselli, Sep 03 2012
    
  • Maple
    with(numtheory);
    A216167:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 1 to q do
    if not isprime(n) then
      a:=n; b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=n; ok:=1;
      for i from 1 to b 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(n); fi;
    fi;
    od; end:
    A216167(1000,5);
  • Mathematica
    Select[Range[6000],CompositeQ[#]&&AllTrue[FromDigits/@Table[Insert[IntegerDigits[#],5,p],{p,IntegerLength[#]}],PrimeQ]&] (* Harvey P. Dale, Oct 02 2022 *)
  • Python
    from sympy import isprime
    def ok(n):
        if n < 2 or n%10 not in {1, 3, 7, 9} or isprime(n): return False
        s = str(n)
        return all(isprime(int(s[:i] + '5' + s[i:])) for i in range(len(s)))
    print(list(filter(ok, range(5698)))) # Michael S. Branicky, Sep 21 2021

A216168 Composite numbers and 1 which yield a prime whenever a 7 is inserted anywhere in them, including at the beginning or end.

Original entry on oeis.org

1, 9, 27, 33, 39, 57, 87, 159, 177, 187, 603, 717, 753, 949, 1257, 1707, 2277, 2367, 4317, 4623, 4779, 4797, 5773, 6757, 6777, 7017, 7471, 7479, 7747, 7797, 7813, 7977, 8797, 9777, 9987, 10777, 11757, 17679, 28269, 28437, 29779, 34177, 34771, 40059, 41721
Offset: 1

Views

Author

Paolo P. Lava, Sep 03 2012

Keywords

Examples

			4623 is not prime but 46237, 46273, 46723, 47623 and 74623 are all primes.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..50000] | not IsPrime(n) and forall{m: t in [0..#Intseq(n)] | IsPrime(m) where m is (Floor(n/10^t)*10+7)*10^t+n mod 10^t}]; // Bruno Berselli, Sep 03 2012
  • Maple
    with(numtheory);
    A216168:=proc(q,x)
    local a,b,c,i,n,ok;
    for n from 1 to q do
    if not isprime(n) then
      a:=n; b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=n; ok:=1;
      for i from 0 to b 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(n); fi;
    fi;
    od; end:
    A216168(1000,7);
Showing 1-4 of 4 results.