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

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

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)}

A164328 a(n) is the smallest n-digit prime term of A158594 and zero if there is no such number.

Original entry on oeis.org

7, 11, 271, 1033, 18289, 133733, 1045493, 11939237, 103333333, 1342313221, 10300335833, 145933933339, 1332523411733, 11653733331833
Offset: 1

Views

Author

Farideh Firoozbakht, Sep 22 2009

Keywords

Comments

It seems that for all n, a(n)>0.
A164327(n) gives us smallest n-digit term of A158594. So A164328(n)>=A164327(n).

Examples

			a(5)=18289 so all the seven numbers 18289, 318289, 138289, 183289, 182389,
182839 & 182893 are primes.
		

Crossrefs

Programs

  • Mathematica
    pp[n_, k_] := Catch[Block[{d = IntegerDigits@n}, Do[If[! PrimeQ[ FromDigits[ Insert[d, k, i]]], Throw[False]], {i, 1+Length@d}]; True]]; a[n_] := Catch[ Block[{p = NextPrime[10^(n-1)]}, While[p < 10^n, If[pp[p, 3], Throw@p, p = NextPrime@p]]; 0]]; a /@ Range[8] (* Giovanni Resta, Aug 13 2013 *)

Extensions

a(11)-a(13) from Donovan Johnson, Apr 14 2010
a(14) from Giovanni Resta, Aug 11 2013

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)}

A306920 a(n) is the smallest prime > 10 where a string of exactly n zeros can be inserted somewhere into the decimal expansion such that the resulting number is also prime.

Original entry on oeis.org

11, 19, 17, 13, 13, 23, 17, 17, 31, 13, 23, 41, 137, 61, 23, 13, 13, 67, 53, 89, 19, 107, 17, 29, 61, 263, 31, 37, 127, 53, 269, 199, 137, 23, 31, 89, 61, 13, 43, 163, 53, 131, 109, 19, 79, 283, 109, 19, 269, 223, 97, 97, 223, 89, 13, 79, 67, 107, 17, 389, 197
Offset: 1

Views

Author

Felix Fröhlich, Mar 16 2019

Keywords

Comments

For many small n, if the decimal expansion of a(n) contains the digit 0, then a(n+1) is a(n) with one zero digit removed. However, this is not true in general. The counterexamples' indices in this sequence are given by A344860.

Examples

			For n = 13: If a string of 13 zeros is inserted between the digits 1 and 3 in 137, the resulting number is 1000000000000037, which is prime. Since 137 is the smallest prime where such a string of 13 zeros can be inserted to get another prime, a(13) = 137.
		

Crossrefs

Programs

  • PARI
    insert(n, len, pos) = my(d=digits(n), v=[], w=[]); for(y=1, pos, v=concat(v, d[y])); v=concat(v, vector(len)); for(z=pos+1, #d, v=concat(v, d[z])); subst(Pol(v), x, 10)
    a(n) = forprime(p=10, , for(k=1, #digits(p)-1, my(zins=insert(p, n, k)); if(ispseudoprime(zins), return(p))))

A304246 Numbers that yield a prime whenever a '1' is inserted between any two digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 21, 31, 33, 37, 49, 63, 67, 69, 79, 81, 91, 99, 103, 109, 117, 123, 151, 163, 181, 193, 211, 213, 231, 241, 279, 309, 319, 363, 367, 391, 411, 427, 429, 453, 457, 459, 501, 513, 519, 547, 571, 601, 613, 621, 631, 697, 703, 709, 721, 729, 777, 787, 801, 811, 817, 879, 903, 951, 981, 987
Offset: 1

Views

Author

M. F. Hasler, Jun 01 2018

Keywords

Comments

The single-digit terms voidly satisfy the condition: no '1' can be inserted anywhere, so all possible insertions yield a prime.
Motivated by sequence A164329 which is the analog for inserting 0.
Compare to A068673 where 1 is prefixed or appended, and to A068679 where 1 is prefixed, appended or inserted anywhere - which is therefore the intersection between this sequence and A068673.
See also A050711 where 1 is inserted between all adjacent digits. - R. J. Mathar, Feb 28 2020

Examples

			21 is in the sequence, because if '1' is inserted between "any" pair consecutive digits (the only possibility being to insert it between the first and second digit, which yields 211), the result is always prime. The definition does not require the term itself to be prime.
103 is in the sequence because inserting 1 between the first and second, or between the second and third digit, would yield 1103 or 1013, respectively, which are both prime.
		

Crossrefs

Cf. A164329 (prime when 0 is inserted anywhere), A216169 (subset of composite terms), A215417 (subset of primes), A159236 (prime when 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).
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), A304245 (prime(k+1) is inserted after the k-th digit, k > 1, or '2' after the first digit).

Programs

  • Magma
    [0] cat [k:k in [1..1000]| forall{i:i in [1..#Intseq(k)-1]| IsPrime(Seqint(Reverse(v[1..i] cat [1] cat v[i+1..#v]))) where v is Reverse(Intseq(k)) }]; // Marius A. Burtea, Feb 09 2020
  • Maple
    filter:= proc(n) local j,t;
      for j from 1 to ilog10(n) do
        if not isprime(10*n-9*(n mod 10^j)+10^j) then return false fi
      od;
      true
    end proc:
    select(filter, [$0..1000]); # Robert Israel, Jun 01 2018
  • PARI
    is(n)=!for(k=1,logint(n+!n,10),isprime(10*n-n%10^k*9+10^k)||return)
    

A304247 Numbers which yield a prime whenever a '2' is inserted between any single pair of adjacent 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, 123, 129, 131, 137, 149, 183, 207, 221, 243, 251, 297, 303, 321, 329, 357, 359, 399, 401, 417, 419, 429, 441, 443, 453, 461, 471, 473, 527, 533, 581, 597, 611, 621
Offset: 1

Views

Author

M. F. Hasler, Jun 01 2018

Keywords

Comments

Motivated by existing sequences defined in an analog way for other digits to be inserted, e.g., A164329 for the digit 0, cf. cross-references.
For single-digit terms, the condition is voidly satisfied: nothing can be inserted.
See also A050712 where 2 is inserted between each pair of adjacent digits. - R. J. Mathar, Feb 28 2020

Examples

			123 is in the sequence because it yields a prime when a '2' is inserted after the first or after the second digit, which yields the prime 1223 in both cases. The term itself does not need to be prime.
		

Crossrefs

Cf. A164329 (prime when 0 is inserted anywhere), 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), A304246 (1 is inserted anywhere).
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. 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), A304245 (prime(k+1) is inserted after the k-th digit, k > 1, or '2' after the first digit).

Programs

  • Maple
    filter:= proc(n) local j,t;
      for j from 1 to ilog10(n) do
        if not isprime(10*n-9*(n mod 10^j)+2*10^j) then return false fi
      od;
      true
    end proc:
    select(filter, [$0..10000]); # Robert Israel, Jun 01 2018
  • PARI
    is(n,p=2,L=logint(n+!n,10)+1,d,P)=!for(k=1,L-1,isprime((d=divrem(n,P=10^(L-k)))[2]+(10*d[1]+p)*P)||return)

A306926 A(n, k) is the k-th prime p > 10 where a string of exactly n zeros can be inserted somewhere into the decimal expansion such that the resulting number is also prime; square array, read by antidiagonals, downwards.

Original entry on oeis.org

11, 13, 19, 17, 23, 17, 19, 31, 19, 13, 37, 41, 71, 23, 13, 41, 43, 73, 29, 23, 23, 53, 47, 79, 37, 73, 31, 17, 59, 53, 97, 59, 79, 43, 37, 17, 61, 59, 103, 71, 89, 107, 53, 19, 31, 67, 67, 149, 97, 179, 127, 59, 47, 43, 13, 71, 71, 151, 103, 223, 131, 61, 61
Offset: 1

Views

Author

Felix Fröhlich, Mar 16 2019

Keywords

Examples

			Array starts as follows:
   11,  13,  17,  19,  37,  41,  53,  59,  61,  67,  71,  79,  89,  97
   19,  23,  31,  41,  43,  47,  53,  59,  67,  71,  89,  97, 107, 109
   17,  19,  71,  73,  79,  97, 103, 149, 151, 157, 173, 181, 223, 229
   13,  23,  29,  37,  59,  71,  97, 103, 127, 137, 139, 157, 181, 199
   13,  23,  73,  79,  89, 179, 223, 233, 239, 241, 263, 269, 277, 281
   23,  31,  43, 107, 127, 131, 137, 139, 149, 151, 163, 173, 179, 181
   17,  37,  53,  59,  61,  67,  71, 107, 109, 151, 179, 193, 197, 211
   17,  19,  47,  61,  67,  71, 157, 181, 197, 227, 313, 347, 353, 367
   31,  43, 103, 113, 127, 137, 149, 157, 163, 173, 191, 241, 257, 277
   13,  79, 113, 139, 163, 191, 293, 313, 349, 397, 433, 439, 443, 449
   23,  79,  89, 137, 149, 151, 163, 181, 199, 229, 239, 241, 277, 311
   41,  79, 131, 157, 167, 197, 199, 227, 229, 233, 241, 347, 349, 359
  137, 167, 191, 197, 227, 277, 281, 313, 337, 353, 389, 421, 439, 449
Antidiagonals as a triangular array:
  11
  13, 19
  17, 23,  17
  19, 31,  19,  13
  37, 41,  71,  23,  13
  41, 43,  73,  29,  23,  23
  53, 47,  79,  37,  73,  31, 17
  59, 53,  97,  59,  79,  43, 37, 17
  61, 59, 103,  71,  89, 107, 53, 19,  31
  67, 67, 149,  97, 179, 127, 59, 47,  43, 13
  71, 71, 151, 103, 223, 131, 61, 61, 103, 79, 23
		

Crossrefs

Cf. A215417, A306920. Row 1 is A164329.

Programs

  • PARI
    insert(n, len, pos) = my(d=digits(n), v=[], w=[]); for(y=1, pos, v=concat(v, d[y])); v=concat(v, vector(len)); for(z=pos+1, #d, v=concat(v, d[z])); subst(Pol(v), x, 10)
    row(n, terms) = my(i=0); if(terms <= 0, print1(""), forprime(p=10, , for(k=1, #digits(p)-1, my(zins=insert(p, n, k)); if(ispseudoprime(zins), print1(p, ", "); i++; break)); if(i>=terms, print(""); break)))
    array(rows, cols) = for(x=1, rows-1, row(x, cols))
    array(12, 10) \\ Print initial 12 rows and 10 columns of array
Showing 1-10 of 12 results. Next