Primorials are like Factorials except that only the prime numbers are multiplied:
2, 6, 30, 210, 2310, 30030, ...
Starting with the first primorial which is at least two digits, consider a sequence composed of the second to last digit of each primorial:
3, 1, 1, 3 ...
The first digit of this sequence is '3'.
Please provide the 999th and 9999th digits of this sequence.
p=4; primorial=6;
for i=1:10
p=nextprime(p+1);
primorial=primorial*p;
fprintf('%3d %10d %15d\n',i, p, primorial)
end
l10=log(10);
p=4; primorial=6; logprimorial=log(primorial)/l10;
for i=1:9999
p=nextprime(p+1);
primorial=mod(primorial*p,100000);
logprimorial=logprimorial+log(p)/l10;
if i==999 || i==9999 || i<11
fprintf('%4d %10d %12.6f %5d\n',i, p,logprimorial, primorial)
end
end
first finds the third through 12th primordial, showing the sequence number for the chosen sequence that starts at the third primordial, accounting for the discrepancy in the numbering; this is followed by the largest prime used and the primorial itself:
1 5 30
2 7 210
3 11 2310
4 13 30030
5 17 510510
6 19 9699690
7 23 223092870
8 29 6469693230
9 31 200560490130
10 37 7420738134810
Then it shows the values mod 100000 so as not to need extra precision; the first 10 (that is, for primorials 3 through 12) are shown for comparison to the full values, then the values for 999th and 9999th in the sequence.
last common last
prime log of five digits
i used primorial of primorial
1 5 1.477121 30
2 7 2.322219 210
3 11 3.363612 2310
4 13 4.477555 30030
5 17 5.708004 10510
6 19 6.986758 99690
7 23 8.348486 92870
8 29 9.810884 93230
9 31 11.302245 90130
10 37 12.870447 34810
999 7927 3396.730742 95390
9999 104743 45341.977414 07090
The next-to-last digit in each of the 1001st and 10001st primorial of the sequence is 9 and thus the 999th and 9999th elements of the sequence. (leading zero of 07090 provided manually)
The common log of the primorial is included just to show how big the primorial is.
|
Posted by Charlie
on 2022-06-14 11:19:53 |