OFFSET
1,2
EXAMPLE
1/1, 2/1, 2/1, 38/5, 236/21, 850/39, 1000/23, 26840/301, 477368/2775, 47036/137, ...
a(4)/A394300(4) = 38/5: The 5 primes in the interval [16,31] are 17, 19, 23, 29, 31. Their A036378(4)*(A036378(4)-1)/2 = (5*4)/2 = 10 mutual differences are 2, 6, 12, 14, 4, 10, 12, 6, 8, 2, with sum 76.
If all numbers from the interval were in the urn, there would be A006516(4) = 120 pairs, with a mean of A000051(4)/3 = (2^4 + 1)/3 = 17/3. The following table shows that the naive assumption that the expected value of the differences of the drawn prime number pairs is always larger than that obtained when all numbers are in the urn is incorrect.
.
2 2/1 2.0 1.667
3 2/1 2.0 < 3.0
4 38/5 7.6 5.667
5 236/21 11.238 11.0
6 850/39 21.795 21.667
7 1000/23 43.478 43.0
8 26840/301 89.169 85.667
9 477368/2775 172.025 171.0
10 47036/137 343.328 341.667
11 22339372/32385 689.806 683.0
12 73096731/53708 1361.002 < 1365.667
14 1180973647/216411 5457.087 < 5461.667
15 3853501438/352995 10916.589 < 10923.0
17 1261487067476/28882563 43676.424 < 43691.0
19 26083459413092/149262459 174748.960 < 174763.0
PROG
(PARI) a394299_300(n) = my(n2=2^n, n22=n2+n2, s=0, k=0); forprime(p1=n2, precprime(precprime(n22)-1), forprime(p2=nextprime(p1+1), n22, s+=(p2-p1); k++)); s/k
CROSSREFS
KEYWORD
nonn,frac,more
AUTHOR
Hugo Pfoertner, Mar 23 2026
STATUS
approved
