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

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

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

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

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

A304244 Numbers that yield a prime when prime(k) is inserted after the k-th digit, for any k >= 1, k < number of digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 23, 27, 29, 41, 51, 53, 77, 81, 83, 87, 89, 99, 101, 149, 191, 239, 251, 287, 317, 353, 359, 419, 473, 497, 509, 527, 533, 611, 677, 743, 797, 809, 821, 887, 893, 941, 983, 1037, 1043, 1277, 1421, 1841, 1853, 1973, 1979, 2543
Offset: 1

Views

Author

M. F. Hasler, May 21 2018

Keywords

Comments

The primes to insert are: 2 (after the first digit), 3 (after the second digit, if there are at least three), etc.
Inspired by A304243 and analog sequences given in cross-references.
The sequence is finite: if insertion of 3 after the second digit yields a prime, then the sum of digits must be congruent to 1 or 2 (mod 3). However, insertion of 2 after the first digit also must yield a prime, so only the second case is possible. But then, insertion of a digit 7 cannot yield a prime, so no term can have 5 digits or more. (Sequence A304243 circumvents this restriction by excluding 3 from the primes to insert, but it is still finite for a similar reason occurring later.)

Examples

			The 1-digit numbers 0..9 are included since the condition is voidly satisfied: Nothing can be inserted, therefore each of the resulting numbers is prime.
17 is in the sequence because 127 is prime.
101 is in the sequence because 1201 and 1031 are prime.
		

Crossrefs

Cf. A304243 (2 is prefixed or prime(k+2) is inserted after the k-th digit).
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).
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,P)={!for(k=1,L-1, isprime((d=divrem(n,P=10^(L-k)))[2]+(10^logint(10*p=prime(k),10)*d[1]+p)*P)|| return)}

A304243 Numbers that yield a prime when prime(k+2) is inserted after the k-th digit (or prime(1) = 2 before the 1st digit for k=0), for 0 <= k <= number of digits.

Original entry on oeis.org

27, 33, 39, 57, 93, 333, 3747, 5073, 5997, 7239, 10053, 22419, 349731, 425991, 714807, 1719279, 81453303, 406253439, 481683189, 886662423, 2653294371
Offset: 1

Views

Author

M. F. Hasler, May 10 2018

Keywords

Comments

The primes to insert are 2 (in front) or 5, 7, 11, 13, ... after the number's first, second, third, ... digit. So there cannot be any 1 digit solution because if 5 is appended this cannot yield a prime. One can show that the terms cannot have more than 21 digits.
The prime 3 is excluded from the strings to insert, because else no term could have more than 2 digits: to be prime with 2 prefixed or with 3 inserted, the number must be congruent to 2 (mod 3), so it cannot be prime with 7 appended or inserted. See also the Rivera link and A304244.

Examples

			a(1) = 27 because 2|27 = 227, 2|5|7 = 257 and 27|7 = 277 are all prime.
Similarly for a(6) = 333, because 2333, 3533, 3373 and 33311 are all prime.
		

Crossrefs

Cf. A304244 (prime(k) is inserted after the k-th digit), A304245 (2 is inserted after the first digit, or prime(k+1) is inserted after the k-th digit for k > 1).
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).
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,P)={isprime(n+2*10^L) && !for(k=1,L, isprime((d=divrem(n,P=10^(L-k)))[2]+(10^logint(10*p=prime(2+k),10)*d[1]+p)*P)|| return)}

A304245 Numbers that yield a prime when '2' is inserted between the first and second digit, or prime(k+1) is inserted after the k-th digit for any k > 1, k < number of digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 23, 27, 29, 41, 51, 53, 77, 81, 83, 87, 89, 99, 101, 113, 129, 149, 159, 179, 191, 203, 213, 221, 237, 251, 267, 269, 273, 281, 287, 293, 297, 321, 329, 357, 359, 401, 417, 419, 429, 441, 461, 471, 497, 509, 531, 561, 581, 603, 611, 663, 669, 687, 699, 707, 711
Offset: 1

Views

Author

M. F. Hasler, May 21 2018

Keywords

Comments

The primes to be inserted are: 2 between 1st and 2nd digit, or 5 between 2nd and 3rd digit, or 7 between 3rd and 4th digit, etc.
The prime 3 is excluded because it would restrict the terms to have no more than 4 digits; see A304244 and the Rivera link in A304243.
The two terms 27 and 87 are the only numbers (with more than one digit) for which 2, 5 or 7 can be inserted between any two digits to yield a prime: all of 227, 257, 277, 827, 857 an 877 are prime. There is no other such number with more than 2 digits.

Examples

			The 1-digit numbers 0..9 are included since the condition is voidly satisfied: nothing can be inserted, therefore each of the resulting numbers is prime.
17 is in the sequence because 127 is prime.
101 is in the sequence because 1201 and 1051 are prime.
		

Crossrefs

Cf. A304243 (2 is prefixed or prime(k+2) is inserted after the k-th digit), A304244 (prime(k) is inserted after the k-th digit) .
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).
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,P)={!for(k=1,L-1, isprime((d=divrem(n,P=10^(L-k)))[2]+(10^logint(10*p=prime(k+(k>1)),10)*d[1]+p)*P)|| return)}
Showing 1-10 of 19 results. Next