Determine the total number of semiprimes below 2023, that are immediately followed by an
emirp.
For example, 22 is a semiprime which is immediately followed by 23. But 23 is NOT an emirp, since 32 is composite.
List all valid pairs in conformity with the provisions of the problem.
*** Computer program/ excel solver aided methods are welcome, but a semi-analytic methodology is preferred.
Assumptions:
The prime number theorem says that pp(y), the probability that y is a prime ~ 1/ln(y)
with A = 0.26 and B = -1.54
I say that probability of an emirp ~ pp^2 (to have it both ways)
This is a very rough approximation that depends on the fact that a number reversed is of the same order of magnitude (has the same number of digits). For 4 digits, pp ranges only from 0.1 to 0.14,
and further, pp^2 is equally likely over- and under-estimates pp*pr, where pr is the probability that y reversed is prime. But, pp^2 is also an over-estimate as it includes palindromic primes (which are not emirps).
I say the probability of y semi-prime followed by y+1 emirp is
~~ ps(y) * pp(y+1)^2.
So,
sum(y=13 to 2023) [ps pp^2] = 14.5
note: Larry found 12 in this range (13-2023) (including the palindromes)
program math
sum=0
do i=13,2023
y=i
x=log(y)
pp=1/log(y+1)
ps=log(x)/x+0.265/x-1.54/x**2
sum=sum+pp**2*ps
enddo
print*,sum
end
>math
14.5202
Edited on January 15, 2023, 3:58 am