"""Numerical values quoted in Section 9 of the paper (not used in the proof). J(N, K) = int_1^N (theta(u + K) - theta(u) - K)^2 du, Z(N; h) = sum_{p, p' <= N, p' - p = h} log p log p' (Goldston's eq. (11)), A(N, K) = sum_{0 < h < K} (K - h) Z(N; h) / (K^2 N / 2) (averaged prime-pair constant), for N = 10^8 and K = c log^2 N, c = 1/4, 1/2, 1 (K = 339 for c = 1). For integer K, theta(u + K) - theta(u) is constant on each [n, n + 1), so J(N, K) = sum_{n=1}^{N-1} (theta(n + K) - theta(n) - K)^2 exactly. Z(N; h) is a dot product of the log p indicator with its shift by h. Everything is evaluated in floating point (float64). As a consistency check, the script prints the difference between the right side of Goldston's identity (25) without its o(K^2 N) term, K N log N + 2 sum_{h5} {'K':>5} {'A(N,K)':>9} {'J/(KN log^2 N)':>15} {'J/(KN log(N/K))':>16} {'((25) - J)/(K^2 N)':>20}") for c, K in KS: J = 0.0 B = 10 ** 7 for a in range(0, len(n), B): nn = n[a:a + B] d = theta[nn + K] - theta[nn] - K J += float(np.dot(d, d)) S = float(sum((K - h) * Z[h] for h in range(1, K))) A = S / (K * K * N / 2) rhs25 = K * N * LN + 2 * S - K * K * N print(f"{c:5.2f} {K:5d} {A:9.4f} {J / (K * N * LN ** 2):15.4f} {J / (K * N * math.log(N / K)):16.4f}" f" {(rhs25 - J) / (K * K * N):20.4f}")