Earlier quoted context omitted.
The person is capable of writing down X, it's a handful of digits. Moreover it is not unreasonable for an amateur mathematician to do so. The fact that they entirely lucky that the series of digits indeed satisfies the mathematical condition we want is incidental but I believe abides by Death Note rules.
I think "capable" also takes into account knowledge they have. It's been a while since I watched Death Note, but isn't this brought up as a reason why Kira can't do, "writes down L's real name, then dies of a heart attack."? It would be theoretically possible for someone to be lucky enough to guess L's real name, but apparently the note has a bullcrap detector or something where it eventually just says, "no, they wou…
Let me put this another way. I think the following would be considered a valid Death Note command.
"Person flips a coin 100 times in a row, and gets heads every time".
Now how is that different from
"Person runs an RNG digit generator 100 times in a row, and gets 9s every time".
Then
"Person runs an RNG digit generator 100 times in a row, the 100 digit number is exactly divisible by 123456".
Then
"Person runs an RNG digit generator 100 times in a row, 2^x-1 of that number is prime".
And if this is all iffy, let me propose an alternative. Let's assume (I'm not 100% sure of this) that we can verify large prime within 23 days. Heck, build a data center to do this if we have to.
"Person runs RNG to generate x such that 2^x-1 is prime. Uses machine and verifies that it is indeed prime. Dies of joy."
You can similarly use this to crack hashes, etc.