User blog comment:Pellucidar12/Idea for a function (Hyperprime counting functions)/@comment-30754445-20170723221034/@comment-30754445-20170723233114

The typical length of a number with a sum-of-digits of 317 is 317/4.5

The density of primes with 317/4.5 digits is 1/(317/4.5*ln(10))

And since the sum of digits is 317, we know the number is not divisible by 3 so the density goes up by a factor of 3/2 to give a final result of:

3/(2*317/4.5*ln(10))

And I really don't see how constraining the sum of digits to a specific largish number like 317 could have a noticable effect on the density of primes. There are many many diverse ways to get a sum of 317, so even if some of those forms skewer the odds it won't have much of an effect overall.

So I think we can be confident in the heuristic process in this case, at least a a good first approximation.

Of-course, with very small sums, the situation could be different. And a sum of 2 is an especially extreme case (10^k+1 cannot be prime unless k is a power of 2).