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 27 results. Next

A247069 a(n) = number of distinct primes obtained when inserting 1 anywhere in A069246(n).

Original entry on oeis.org

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

Views

Author

Zak Seidov, Nov 17 2014

Keywords

Comments

Among the first 145 terms the largest is a(140)=9 because inserting 1 in 12 places into A069246(140)=18064911343, we get only 9 distinct primes (in the order of their appearances): 118064911343, 181064911343, 180164911343, 180614911343, 180641911343, 180649111343, 180649113143, 180649113413, 180649113431.

Examples

			a(7)=2 because inserting 1 in 4 possible places into A069246(7)=151 we get only 2 distinct primes, 1151 and 1511.
		

Crossrefs

Cf. A069246.

A215417 Primes that remain prime when a single zero digit is inserted between any two adjacent digits.

Original entry on oeis.org

11, 13, 17, 19, 37, 41, 53, 59, 61, 67, 71, 79, 89, 97, 109, 113, 131, 149, 191, 197, 227, 239, 269, 281, 283, 337, 367, 379, 383, 401, 421, 449, 457, 499, 503, 509, 587, 607, 673, 701, 719, 727, 739, 757, 809, 811, 887, 907, 929, 991, 1009, 1061, 1093, 1103
Offset: 1

Views

Author

Paolo P. Lava, Aug 10 2012

Keywords

Examples

			399617 is prime and also 3996107, 3996017, 3990617, 3909617, 3099617.
		

Crossrefs

Programs

  • Maple
    A215417:=proc(q)
    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); if not isprime(c) then ok:=0; break; fi;
      od;
      if ok=1 then print(ithprime(n)); fi;
    od; end:
    A215417(1000);
  • Mathematica
    Select[Prime[Range[5,200]],And@@PrimeQ[Table[FromDigits[Insert[ IntegerDigits[ #],0,n]],{n,2,IntegerLength[#]}]]&] (* Harvey P. Dale, Feb 23 2014 *)
  • PARI
    is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=0; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012

A215419 Primes that remain prime when a single digit 3 is inserted between any two consecutive digits or as the leading or trailing digit.

Original entry on oeis.org

7, 11, 17, 31, 37, 73, 271, 331, 359, 373, 673, 733, 1033, 2297, 3119, 3461, 3923, 5323, 5381, 5419, 6073, 6353, 9103, 9887, 18289, 23549, 25349, 31333, 32933, 33349, 35747, 37339, 37361, 37489, 47533, 84299, 92333, 93241, 95093, 98491, 133733, 136333, 139333
Offset: 1

Views

Author

Paolo P. Lava, Aug 10 2012

Keywords

Examples

			18289 is prime and also 182893, 182839, 182389, 183289, 138289, 318289.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,d,k,M;
    if not isprime(n) then return false fi;
    L:= convert(n,base,10);
    d:= nops(L);
    for k from 0 to d do
       M:= [seq(L[i],i=1..k),3,seq(L[i],i=k+1..d)];
       if not isprime(add(M[i]*10^(i-1),i=1..d+1)) then return false fi;
    od;
    true
    end proc;
    select(filter, [seq(i,i=3..2*10^5,2)]); # Robert Israel, Oct 09 2017
  • Mathematica
    ins@n_:=Insert[IntegerDigits@n,3,#]&/@Range@(IntegerLength@n+1);
    Cases[{#,FromDigits@#&/@ins@#}&/@ Cases[Range[11,70000],?PrimeQ], {,{?PrimeQ..}}][[All,1]] (* _Hans Rudolf Widmer, Dec 21 2023 *)

A068679 Numbers which yield a prime whenever a 1 is inserted anywhere in them (including at the beginning or end).

Original entry on oeis.org

1, 3, 7, 13, 31, 49, 63, 81, 91, 99, 103, 109, 117, 123, 151, 181, 193, 213, 231, 279, 319, 367, 427, 459, 571, 601, 613, 621, 697, 721, 801, 811, 951, 987, 1113, 1117, 1131, 1261, 1821, 1831, 1939, 2101, 2149, 2211, 2517, 2611, 3151, 3219, 4011, 4411, 4519, 4887, 5031, 5361, 6231, 6487, 6871, 7011, 7209, 8671, 9141, 9801, 10051
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Comments

If R(p) = (10^p-1)/9 is a prime then (10^(p-1)-1)/9 belongs to this sequence.

Examples

			123 belongs to this sequence as the numbers 1123, 1213, 1231 obtained by inserting a 1 in all possible ways are all primes.
		

Crossrefs

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; ins[n_]:=FromDigits/@Table[Insert[d[n],1,k],{k,Length[d[n]]+1}]; Select[Range[10060],And@@PrimeQ/@ins[#] &] (* Jayanta Basu, May 20 2013 *)
    Select[Range[11000],AllTrue[FromDigits/@Table[Insert[ IntegerDigits[ #],1,n],{n,IntegerLength[#]+1}],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 16 2020 *)
  • Python
    from sympy import isprime
    A068679_list, n = [], 1
    while len(A068679_list) < 1000:
        if isprime(10*n+1):
            s = str(n)
            for i in range(len(s)):
                if not isprime(int(s[:i]+'1'+s[i:])):
                    break
            else:
                A068679_list.append(n)
        n += 1 # Chai Wah Wu, Oct 02 2019

Extensions

More terms from Eli McGowan (ejmcgowa(AT)mail.lakeheadu.ca), Apr 11 2002
More terms from Vladeta Jovovic, Apr 16 2002

A164329 Numbers which yield a prime whenever a zero is inserted between any two digits.

Original entry on oeis.org

11, 13, 17, 19, 37, 41, 49, 53, 59, 61, 67, 71, 79, 89, 97, 109, 113, 119, 121, 131, 133, 149, 161, 169, 191, 197, 203, 227, 239, 253, 269, 281, 283, 299, 301, 319, 323, 337, 367, 379, 383, 401, 403, 407, 421, 449, 457, 473, 493, 499, 503, 509, 511, 539, 551
Offset: 1

Views

Author

Farideh Firoozbakht, Sep 22 2009

Keywords

Comments

Single-digit numbers 0, ..., 9 seem to be excluded but would satisfy the condition voidly. - M. F. Hasler, May 10 2018

Examples

			998471 is in the sequence because all the five numbers 9098471, 9908471, 9980471, 9984071 and 9984701 are primes.
		

Crossrefs

Cf. A216169 (subset of composite terms), A215417 (subset of primes), A159236 (0 is inserted between all digits).
Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended).
Cf. A158594 (3 is prefixed, appended or inserted anywhere), A215419 (primes among these).
Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).
Cf. A069833 (9 is prefixed, appended or inserted anywhere), A215421 (primes among these).
Cf. A158232 (13 is prefixed or appended).

Programs

  • Mathematica
    f[n_]:=(r=IntegerDigits[n];l=Length[r];For[k=2,PrimeQ[FromDigits[Insert
    [r,0,k]]],k++ ];If[k==l+1,n,0]);Select[Range[11,560],f[ # ]>0&]
  • PARI
    is(n, L=logint(n+!n, 10)+1, P)={!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

Erroneous comment and cross-references deleted by M. F. Hasler, May 10 2018

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

A069833 Prefixing, suffixing or inserting a 9 in the number anywhere gives a prime.

Original entry on oeis.org

7, 19, 37, 41, 91, 199, 209, 239, 311, 539, 587, 661, 749, 923, 931, 941, 967, 1009, 1079, 1139, 1997, 2717, 2959, 3971, 3979, 4559, 4993, 4999, 5393, 5629, 5651, 6401, 6739, 6911, 8213, 8491, 8939, 9109, 9397, 9607, 9679, 9829, 11089, 11227, 13943
Offset: 1

Views

Author

Amarnath Murthy, Apr 14 2002

Keywords

Crossrefs

Cf. A215421 (subsequence of primes).
Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended).
Cf. A158594 (3 is prefixed, appended or inserted anywhere), A215419 (primes among these).
Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).
Cf. A158232 (13 is prefixed or appended).
Cf. A164329 (0 is inserted), A216169 (subset of composite terms), A215417 (subset of primes), A159236 (0 is inserted between all digits).

Programs

  • PARI
    is(n,L=logint(n+!n,10)+1,d,P)={!for(k=0,L,isprime((d=divrem(n,P=10^(L-k)))[2]+(10*d[1]+9)*P)||return)} \\ M. F. Hasler, May 10 2018

Extensions

More terms from Vladeta Jovovic, Apr 16 2002
Corrected offset by Chai Wah Wu, Oct 10 2019

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

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

Original entry on oeis.org

11, 23, 47, 83, 131, 173, 179, 233, 353, 389, 521, 569, 641, 683, 839, 887, 911, 971, 983, 1229, 1289, 1913, 2087, 2663, 2837, 2879, 3329, 3671, 3677, 3803, 3821, 4259, 4409, 4817, 4871, 4889, 5237, 5477, 5693, 6449, 6581, 6863, 7283, 7487, 7583, 7823, 7853
Offset: 1

Views

Author

Paolo P. Lava, Sep 25 2012

Keywords

Comments

These numbers are either isolated primes or the smaller of a pair of twin primes. - Davide Rotondo, Mar 11 2025

Examples

			325421 is prime and also 3254281, 3254821, 3258421, 3285421 and 3825421.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesInInterval(11,8000) | forall{m: t in [1..#Intseq(p)-1] | IsPrime(m) where m is (Floor(p/10^t)*10+8)*10^t+p mod 10^t}]; // Bruno Berselli, Sep 26 2012
    
  • Maple
    A217044:=proc(q,x) local a,b,c,d,i,k,n,ok,v; v:=[]; a:=10;
    for n from 1 to q do a:=nextprime(a); d:=length(a); ok:=1;
    for k from 1 to d-1 do b:=a mod 10^k; c:=trunc(a/10^k); i:=x*10^k+b; i:=c*10^length(i)+i;
    if not isprime(i) then ok:=0; break; fi; od; if ok=1 then v:=[op(v),a]; fi; od; op(v); end:
    A217044(10^3,8);
  • PARI
    is(n)=my(v=concat([""],digits(n)));for(i=2,#v-1,v[1]=Str(v[1], v[i]); v[i]=8;if(i>2,v[i-1]="");if(!isprime(eval(concat(v))), return(0)));isprime(n) \\ Charles R Greathouse IV, Sep 25 2012
    
  • Python
    from sympy import isprime, primerange
    def ok(p):
        if p < 10: return False
        s = str(p)
        return all(isprime(int(s[:i] + "8" + 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(7854)) # Michael S. Branicky, Nov 23 2021

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
Showing 1-10 of 27 results. Next