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.

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

A344637 a(n) is the smallest k > 0 such that the number that results from inserting a string of k zeros between all adjacent digits of prime(n) is also prime, or 0 if no such k exists.

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 30, 1, 1
Offset: 5

Views

Author

Felix Fröhlich, May 25 2021

Keywords

Comments

Is a(26) = 0? Note that prime(26) = 101 and 101 is the largest known prime of the form 10^t + 1.
a(A000720(A004022(i))) = 0 for i > 1, i.e., a(n) = 0 if prime(n) is a repunit > 11.

Examples

			For n = 10: prime(10) = 29 and 200009 is the smallest prime obtained by inserting a string of zeros between all adjacent digits, so a(10) = 4.
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    insert_zeros(num, len) = my(d=digits(num), v=[]); for(k=1, #d-1, v=concat(v, concat([d[k]], vector(len)))); v=concat(v, d[#d]); eva(v)
    a(n) = my(p=prime(n)); for(k=1, oo, if(ispseudoprime(insert_zeros(p, k)), return(k)))

A344860 Numbers k such that A306920(k) contains the digit 0 and A306920(k+1) is not A306920(k) with a digit 0 removed.

Original entry on oeis.org

192, 238, 250, 293, 312, 346, 382, 432, 436, 446, 465, 510, 544, 554, 560, 571, 578, 583, 593, 607, 609, 631, 658, 671, 727, 729, 771, 780, 803, 812, 825, 844, 845, 848, 860, 866, 877, 883, 894, 917, 945, 962, 967, 974, 991, 1000, 1004, 1031, 1042, 1052, 1061
Offset: 1

Views

Author

Felix Fröhlich, May 31 2021

Keywords

Examples

			A306920(192) = 1021, containing the digit 0, A306920(193) = 1039 and 1039 cannot be obtained by removing a 0 digit from 1021, so 192 is a term of the sequence.
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    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])); eva(v)
    a306920(n) = forprime(p=10, , for(k=1, #digits(p)-1, my(zins=insert(p, n, k)); if(ispseudoprime(zins), return(p))))
    remove_zeros(n) = my(v=[], w=[], d=digits(n)); for(x=1, #d, if(d[x]==0, for(y=1, x-1, w=concat(w, d[y])); for(z=x+1, #d, w=concat(w, d[z]))); if(#w > 0, v=concat(v, [eva(w)])); w=[]); vecsort(v, , 8)
    is(n) = my(x=a306920(n), y=a306920(n+1), rz=remove_zeros(x)); if(#setintersect([0], vecsort(digits(x)))==0, return(0)); for(k=1, #rz, if(y==rz[k], return(0))); 1
Showing 1-3 of 3 results.