login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354440 Digitally delicate primes where the number of digits appended on the left needed to get a prime increases. 0

%I #62 Dec 21 2022 21:25:33

%S 294001,604171,971767,2690201,10564877,104097043,354975121,1378229029,

%T 1444623667,1594371379,3979115747,15737262803,22090236251,28198307351,

%U 35373071549,49430022721,67580736437,142243533671,659956292591,1385321944133

%N Digitally delicate primes where the number of digits appended on the left needed to get a prime increases.

%C Digitally delicate primes (A050249) are primes such that if any single digit is changed the new number is composite. This sequence gives the smallest such prime that needs more digits added to the left to get to another prime. While this list is not complete it has been shown to be finite. A widely digitally delicate prime is known which never becomes prime regardless of the number of extra digits.

%C 294001 can add 1

%C 604171 can add 3

%C 971767 can add 4

%C 2690201 can add 5

%C 10564877 can add 6

%C 104097043 can add 7

%C 354975121 can add 10

%C 1378229029 can add 11

%C 1444623667 can add 12

%C 1594371379 can add 14

%C 3979115747 can add 15

%C 15737262803 can add 16

%C 22090236251 can add 20

%C 28198307351 can add 26

%C 35373071549 can add 27

%C 49430022721 can add 28

%C 67580736437 can add 30

%C 142243533671 can add 47

%C 659956292591 can add 59

%C 1385321944133 can add 76

%D Michael Filaseta and Jeremiah Southwick, Primes that become composite after changing an arbitrary digit, Math. Comp. (2021) Vol. 90, 979-993. doi:10.1090/mcom/3593

%e You can add any 1 extra digit on the left to 294001 without getting a prime but adding two digits would allow for the creation of a prime. For example 10294001 is prime but none of X294001 are.

%e Starting at 604171 you could add 3 extra digits to the left but not 4 without being able to produce a prime number.

%e X604171 is not prime

%e X0604171 is not prime

%e X00604171 is not prime

%e however 4000604171 is a prime number

%e For the largest one found so far

%e X1385321944133

%e X01385321944133

%e X001385321944133

%e ...

%e X000000000000000000000000000000000000000000000000000000000000000000000000001385321944133 are all composite

%e but 900000000000000000000000000000000000000000000000000000000000000000000000000001385321944133 is prime

%o (Java)

%o import java.math.BigInteger;

%o public class delicateprimes {

%o public static void main(String[] args) {

%o BigInteger i,reci=new BigInteger("0");

%o i= new BigInteger("1");

%o long count=0, v,rec=-1;

%o for(long loop=1;;loop++)

%o {

%o i=i.nextProbablePrime();

%o v = delicate(i,true);

%o if(v>rec) {count++; rec=v;reci=i;System.out.println("REC=("+reci+", "+rec+") " +loop +" "+count);}

%o if(loop%100000==0)System.out.println("Still running, last prime seen was "+i);

%o }

%o }

%o static int delicate(BigInteger a,boolean f) // Returns how many digits can be tacked on the delicate prime. f=false just tests the prime with no extra 0s

%o {

%o int e, length,max=200;

%o if(!f)max=1;

%o String num="", num2="";

%o if(!prime(a))return -1;

%o for(e=0;e<max;e++) //While widely digitally delicate primes do exist, this needs to have a stop point

%o {

%o num=zeros(e)+a.toString();

%o if(e>0)length=e;else length = num.length();

%o for(int j=0;j<length;j++)

%o {

%o for(int k=0;k<=9;k++)

%o {

%o num2=num.substring(0,j)+k+num.substring(j+1);

%o if(num2.contentEquals(num))continue;

%o if(prime(new BigInteger(num2))) {return e-1;}

%o }

%o }

%o }

%o return e-1;

%o }

%o static boolean prime(BigInteger a)

%o {

%o return a.isProbablePrime(100);

%o }

%o static String zeros(int n)

%o {

%o StringBuffer temp=new StringBuffer("");

%o for(int i=0;i<n;i++)temp=temp.append("0");

%o return temp.toString();

%o }

%o }

%Y Cf. A050249 (digitally delicate primes).

%K nonn,base,more

%O 1,1

%A _Jason Rodgers_, May 29 2022

%E Partially edited by _N. J. A. Sloane_, Sep 03 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 19:00 EDT 2024. Contains 374540 sequences. (Running on oeis4.)