# The proportion of primes whose digit sum is prime, out of all primes

## Background:

I recently got an idea. My idea was analyzing primes whose digit sum is prime.

This is a property of some primes ($$> 1$$ digit):

The sum of its digits is prime.

I will call a special prime like this $$P$$.

For primes in the range $$1, these are all $$P$$:

$$2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89$$

Here the proportion of $$P$$s out of all primes in $$1 is $$\frac{14}{25} = 0.56$$ (more than half).

For this general proportion, the number of $$P$$ divided by the total primes in some range $$1, I will define a function $$\text{prop}(a)$$ for that proportion. $$\text{prop}(100)=\frac{14}{25}=0.56$$.

To find the $$P$$s and the number of $$P$$s in a range $$1, I made the computer automate it (I’m gonna trust the python program, if anyone finds mistakes then please let me know)

Hence, in the range $$1, these are the $$P$$:

$$2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 223, 227, 229, 241, 263, 269, 281, 283, 311, 313, 317, 331, 337, 353, 359, 373, 379, 397, 401, 409, 421, 443, 449, 461, 463, 467, 487, 557, 571, 577, 593, 599, 601, 607, 641, 643, 647, 661, 683, 719, 733, 739, 751, 757, 773, 797, 809, 821, 823, 827, 829, 863, 881, 883, 887, 911, 919, 937, 953, 971, 977, 991$$

and $$\text{prop}(1000)\approx \frac{89}{168} \approx 0.52$$.

And I’ll give it to you also for $$1 (sorry for the spam of numbers):

$$\tiny{2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 223, 227, 229, 241, 263, 269, 281, 283, 311, 313, 317, 331, 337, 353, 359, 373, 379, 397, 401, 409, 421, 443, 449, 461, 463, 467, 487, 557, 571, 577, 593, 599, 601, 607, 641, 643, 647, 661, 683, 719, 733, 739, 751, 757, 773, 797, 809, 821, 823, 827, 829, 863, 881, 883, 887, 911, 919, 937, 953, 971, 977, 991, 1013, 1019, 1031, 1033, 1039, 1051, 1091, 1093, 1097, 1103, 1109, 1123, 1129, 1163, 1181, 1187, 1213, 1217, 1231, 1237, 1259, 1277, 1279, 1291, 1297, 1301, 1303, 1307, 1321, 1327, 1361, 1367, 1381, 1433, 1439, 1451, 1453, 1459, 1471, 1493, 1499, 1523, 1543, 1549, 1567, 1583, 1613, 1619, 1637, 1657, 1693, 1697, 1709, 1721, 1723, 1741, 1747, 1783, 1787, 1811, 1831, 1871, 1873, 1877, 1901, 1907, 1949, 2003, 2027, 2029, 2063, 2069, 2081, 2083, 2087, 2089, 2111, 2113, 2131, 2137, 2153, 2179, 2203, 2207, 2221, 2243, 2267, 2269, 2281, 2287, 2311, 2333, 2339, 2351, 2357, 2371, 2377, 2393, 2399, 2423, 2441, 2447, 2467, 2531, 2539, 2551, 2557, 2579, 2591, 2593, 2609, 2621, 2647, 2663, 2683, 2687, 2711, 2713, 2719, 2731, 2753, 2777, 2791, 2801, 2803, 2843, 2861, 2917, 2939, 2953, 2957, 2971, 2999, 3011, 3019, 3037, 3079, 3109, 3121, 3163, 3167, 3169, 3181, 3187, 3217, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3323, 3329, 3343, 3347, 3361, 3389, 3413, 3433, 3457, 3491, 3527, 3529, 3541, 3547, 3581, 3583, 3613, 3617, 3631, 3637, 3659, 3671, 3673, 3677, 3691, 3701, 3709, 3727, 3761, 3767, 3833, 3851, 3853, 3907, 3923, 3929, 3943, 3947, 3989, 4001, 4003, 4007, 4021, 4027, 4049, 4111, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4229, 4241, 4243, 4261, 4283, 4289, 4337, 4339, 4357, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4463, 4481, 4483, 4513, 4517, 4519, 4591, 4603, 4621, 4643, 4649, 4663, 4733, 4751, 4793, 4799, 4801, 4861, 4889, 4919, 4931, 4933, 4937, 4951, 4973, 4999, 5011, 5039, 5051, 5059, 5077, 5099, 5101, 5107, 5147, 5167, 5189, 5231, 5233, 5237, 5273, 5279, 5297, 5303, 5309, 5323, 5347, 5381, 5387, 5413, 5417, 5419, 5431, 5437, 5471, 5477, 5501, 5503, 5507, 5521, 5527, 5563, 5581, 5639, 5651, 5653, 5657, 5693, 5701, 5741, 5743, 5783, 5813, 5851, 5879, 5897, 5903, 5923, 5927, 5981, 5987, 6007, 6029, 6043, 6047, 6067, 6089, 6113, 6131, 6133, 6151, 6173, 6197, 6203, 6221, 6229, 6247, 6263, 6269, 6287, 6311, 6317, 6337, 6353, 6359, 6373, 6421, 6427, 6449, 6481, 6551, 6553, 6571, 6599, 6607, 6661, 6689, 6719, 6733, 6737, 6779, 6791, 6803, 6823, 6827, 6841, 6863, 6869, 6911, 6917, 6959, 6971, 6977, 6997, 7013, 7019, 7039, 7057, 7079, 7103, 7109, 7121, 7127, 7129, 7187, 7211, 7213, 7219, 7237, 7253, 7307, 7309, 7321, 7349, 7411, 7417, 7433, 7451, 7457, 7499, 7507, 7523, 7529, 7541, 7547, 7561, 7583, 7589, 7673, 7691, 7699, 7703, 7723, 7727, 7741, 7789, 7817, 7853, 7877, 7879, 7901, 7907, 7949, 8009, 8069, 8081, 8087, 8111, 8117, 8171, 8191, 8209, 8221, 8243, 8263, 8311, 8317, 8353, 8423, 8429, 8443, 8447, 8461, 8513, 8537, 8573, 8597, 8599, 8609, 8623, 8627, 8641, 8663, 8669, 8681, 8689, 8713, 8731, 8753, 8779, 8803, 8807, 8821, 8849, 8861, 8867, 8887, 8933, 8951, 9011, 9013, 9059, 9091, 9103, 9109, 9127, 9161, 9181, 9239, 9257, 9293, 9323, 9341, 9343, 9413, 9419, 9431, 9433, 9437, 9473, 9479, 9491, 9497, 9521, 9587, 9613, 9631, 9677, 9679, 9697, 9721, 9743, 9749, 9767, 9769, 9787, 9811, 9833, 9839, 9851, 9857, 9859, 9901, 9923, 9929, 9941, 9949, 9967}$$

Here, $$\text{prop}(10000) \approx \frac{590}{1229} \approx 0.48$$.

Here are some other proportions I found using Python:

• $$\text{prop}(100 \ 000) \approx \frac{3883}{9592} \approx 0.40$$
• $$\text{prop}(1 \ 000 \ 000)\approx \frac{30123}{78498} \approx 0.38$$
• $$\text{prop}(10 \ 000 \ 000)\approx \frac{246982}{664579} \approx 0.37$$
• $$\text{prop}(100 \ 000 \ 000) \approx \frac{2163899}{5761455} \approx 0.37$$
• $$\text{prop}(1 \ 000 \ 000 \ 000) \approx \frac{18661619}{50847534}\approx 0.37$$

## Question:

What does this proportion, $$\text{prop}(a)$$, approach in the limit $$\lim\limits_{n \to \infty} \text{prop}(10^n)$$? For me there are two options:

• It randomly jumps.
• It approaches a value $$0.36 > v > 0.37$$.
• It approaches $$0$$.

I’m not sure which one.

Note: This entire idea and algorithm was just an idea of mine.

• What does your notation $\lim\limits_{n\to \infty} 1<p<10^n$ mean?
– Aig
Commented Mar 11 at 11:41
• Maybe it’s better to denote your proportion. For example, let $f(n)$ be the number of good primes in $[11,n]$ divided by the number of all primes. Then we want to find $\lim\limits_{n\to \infty} f(10^n)$. Edit Your whole post is devoted to this proportion, so it’s better to have a notation for it.
– Aig
Commented Mar 11 at 11:48
• It's not clear what $\lim_{n\to \infty} 1<p<10^n$ means unless you somehow mean $\infty<p<10^n$ which I doubt. I suggest removing that and editing for clarity.
– lulu
Commented Mar 11 at 11:48
• Your value for $10^9$ looks very wrong. Commented Mar 13 at 0:36
• @GerryMyerson I got that value from here: math.stackexchange.com/questions/4879597/…… I just realized they changed it. Commented Mar 17 at 13:22

This sequence of primes has been studied before, and is sequence A046704 in the On-line Encyclopedia of Integer Sequences. There is a 2012 research paper by Glyn Harman devoted to analysis of the growth of the sequence (including the same definition but in a general base), which is available here but is very technical. (Without assuming strong unsolved conjectures you can't analyse its growth directly but have to look at how the sum of reciprocals of entries of the sequence grows.)

 Looking at the paper in more detail, Harman proves that the sum of the reciprocals of such primes below $$n$$ is about $$1.5\log\log\log n$$, where $$c$$ is some constant that depends on the base. Since the sum of reciprocals of all primes up to $$n$$ is about $$\log\log n$$, it follows that provided the limit of your proportion exists, it must be $$0$$.

• Which goes to show: if you are looking at some sequence of integers, the first place you should look is the OEIS, and not Math SE. :/ Commented Mar 11 at 14:09