What is the first 21 digit prime in consecutive digits of $e$?

1.4k Views Asked by At

This is a challenge question from a bitcoin giveaway on an image I recently saw

In order to find the 10th digit of $e$ I saw a few individuals write a line of code for it, I wanted to replicate it for the 21st but I know nothing of code. This is the link to the giveaway itself.

Edit (NOT OP) :

1.Where can one get as many digits of $e$ as needed from? so that keep checking every 21 blocks for being prime

2.What is a quick way to check 21 digit odd numbers quickly for primality?

1

There are 1 best solutions below

0
On

To solve this problem :

$1)$ Download PARI/GP

$2)$ Calculate e as accurate as you want, even 1 million digits do not take very long. You just have to establish enough memory with allocatemem()

$3)$ Convert each block of length $21$ that does not begin with a $0$ with the command isprime(,2) which is a rigorous primality test. The best way is probably to create an array with the digits-command.

$4)$ The first such block is the answer.

I did not post the full code, but I mentioned the necessary commands. I want to leave a little work to the OP.