Is the number of additive primes between $1$ and $1\text{,}000 \text{,} 000 \text{,} 000$ known?

120 Views Asked by At

Since I’m researching and experimenting with special kinds of primes (I asked this question about them, you can see their definition there), which I just realized are called “additive primes” in mathematical terms (didn’t know), I have a question about them:

Is the number of additive prime numbers between $1$ and $1 \text{,} 000 \text{,} 000 \text{,} 000$ known?

I am asking this because I am exploring the distribution of additive primes, and I am trying to find the proportion of additive primes out of all primes in a range $1<p<10^n$ for some $n \in \mathbb Z^+$. Using a Python program, I computed these values for all $0<n \leq 8$, but the program is taking too long for $n=9$ ($1 \text{,} 000 \text{,} 000 \text{,} 000$, or $1$ billion).

Hence, this ever been calculated before, maybe in a paper or somewhere? So far I can’t find anything.

1

There are 1 best solutions below

1
On BEST ANSWER

I just make a quick and dirty code that uses an already found list of primes up to 1 bilion.

The file can be found here

The code I have used is:

def sum_digit(n):
    sum = 0
    while (n != 0): 
   
        sum = sum + (n % 10)
        n = n//10
   
    return sum


with open('additive_primes.txt', 'w+') as f:
    file=open("billion-primes.txt","r")

    for prime in file.readlines():
        digit_sum=sum_digit(int(prime))
        if digit_sum in (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79):
           f.write('%s\n' %prime)

f.close()
file.close()

It took less then one minute to check all the primes (but I used the list of primes from the source I have linked. Of course bilion-primes.txt is the text file taken from the source

here is a link to the file containing the list of all the additive primes up to 1 bilion

If you are only interested to the number of such primes, it is: $$ 18\text{,}661\text{,}619 $$