Determine the minimum value of a 100- digit prime number such that we will obtain two other prime numbers by changing its leftmost digit.
p=nextprime(sym(10^99)); % 10^99 has 100 digits, counting the 1
diff=sym(10^99);
found=false; p0ct=0;
while found==false
p0ct=p0ct+1;
ct=0;
for p1=p+diff:diff:p+8*diff
if isprime(p1)
ct=ct+1;
if ct>=2
found=true;
end
end
end
if ct>0
disp(p);
disp(p-diff)
for i=0:8
p1=p+i*diff;
if isprime(p1)
disp(1+i)
end
end
end
p=nextprime(p+1);
end
disp(p0ct)
found that the 340th prime with 100 digits, that is, 10^99 + 76353 led to two other primes by replacing the first digit: 5*10^99 + 76353 and 7*10^99 + 76353.
The printout displays each instance where even one additional prime is found, and stops right after finding a set where two additional primes are found.
The sequence of lines is:
The prime number initially found (ellipses for many of the zeros).
The difference above 10^99
The first digits of the set of primes (2 or 3 lines)
Those with two such first digits are non-solutions as there is only one after the first. Tow such prime numbers after the first makes a total of three, as in the final set
100000...000000000076353
The digits beyond the string of 94 zeros:
76353
The three possible first digits:
1
5
7
The full set of found primes, with their substitute first digits:
100000...000000000006151
6151
1
6
100000...000000000015691
15691
1
7
100000...000000000015843
15843
1
7
100000...000000000020467
20467
1
3
100000...000000000023307
23307
1
7
100000...000000000028441
28441
1
9
100000...000000000036369
36369
1
5
100000...000000000038619
38619
1
8
100000...000000000041011
41011
1
7
100000...000000000043173
43173
1
7
100000...000000000052519
52519
1
4
100000...000000000053487
53487
1
8
100000...000000000060993
60993
1
4
100000...000000000068101
68101
1
4
100000...000000000068851
68851
1
9
100000...000000000069051
69051
1
7
100000...000000000071203
71203
1
7
100000...000000000071649
71649
1
8
100000...000000000073773
73773
1
8
100000...000000000075493
75493
1
4
100000...000000000076353
76353
1
5
7
340 [primes found beginning with digit 1
... most with not even one other corresponding found prime]
|
Posted by Charlie
on 2023-01-19 09:18:29 |