Code: Consecutive Prime Biases
For the project Unexpected biases in the distribution of consecutive primes, both Sage and C++ were used. Roughly speaking, Sage was used to compute things on the theoretical side (e.g., Conjecture 1.1 and Equation (2.16)) while C++ was used to compute the actual occurrences of various patterns. Since the C++ code relies on the primesieve library, we also provide a raw .csv file containing the results for many length two races.
Sage: Conjectured asymptotics and predictions
- twotermpredictions-sage.txt. This contains the code needed to compute everything involved in the conjecture for patterns of length two. In particular, it has the code needed to compute the prediction in Conjecture 1.1 for π(x;q,(a,b)), including the involved c1(q;(a,b)) and c2(q;(a,b)). It is also able to perform the numerical integration involved in the refined (2.16).
- Code for longer patterns coming soon.
C++: Actual occurrences of patterns
- bias_interval.cpp. Computes π(y;q,a)-π(x;q,a) for any modulus q and patterns of any length. Runtime is roughly linear in y. Binary, compiled on an 64bit Linux system.
- bias_first_n.cpp. Given N, this computes π(x0;q,a), where π(x0)=N+π(q). (This is useful for eyeballing equidistribution.) The runtime is roughly linear in x0. Binary, compiled on a 64bit Linux system.
Raw Data
- big_list_e12.csv. This is a CSV formatted file containing the values of π(x;q,(a,b)) for x a power of 10, from 105 to 1012. The moduli included are 3, 4, 5, 6, 7, 8, 9, 11, 12, and 24.
|