Is $4\underbrace{999 . . . 9}_{224 ({\rm times})}$ prime?
I wanted to find smallest prime its sum of digits is $2020$. I started with small primes; the smallest three digits prime its sum of digits is 22 is $499$; four digits is $4999$ with sum of digits 31, five digit is $49999$ with sum of 40.For the sum $2020$ we have:
$2020=224\times 9+4$ and desired number can be of the form $4\underbrace{999 . . . 9}_{224 ({\rm times})}$ . So this number has at least 225 digits. If it is not prime we have to search for numbers with number of digits more than 225 which of course have digits less than 9 and first digit probably less than 4. I could not check it with my computer. I have these questions:
1- is $4\underbrace{999 . . . 9}_{224 ({\rm times})}$ primes?
2- are numbers of the form $499 . . . 99$ always primes? If so what is theoretical reason? If not what is conditions for it to be prime?
Update: the closed form of these numbers is $N=5\times 10^n-1=5(10^n-1)+ 4$, $n ≥ 2$ if n is even we have:
$10^{2k}-1=(10^k-1)(10^k+1)$
Since $[10^n-1, 5, 4]=1$ N can be a prime, but brute force gives a counter result. If n is odd N can be composite.
However, if you instead would satisfy yourself with the smallest prime whose sum of digits in binary is equal to $2020$, then the solution would be the prime number $2^{2021}-2^{1359}-1$, having $609$ (decimal) digits, according to sequence $b(n)=\text{A061712}$ which is available in OEIS.
– Vepir Mar 13 '20 at 19:50px=(5*10^224-1);ispseudoprime(px)and got the result0which meansnotwhich means : already pseudoprime-test gives compositeness. You can get Pari/GP from University Bordeaux to play a bit with number theory. – Gottfried Helms Mar 17 '20 at 18:18