The code is related to the article preprint Ternary quadratic forms representing arithmetic progressions by T. Hejda a V. Kala.
There are two basic parts. First, universal
is the script used in §3.1 of the article. Second, count
is the script used in §3.3 and §3.4 of the article. The code used in §3.2 is not included.
Two files are needed from the repo: universal.py
and create_number_lists.sage
. If you do not have SageMath installed, you also need number_lists.py
. How to run:
- Run
create_number_lists.sage
. This will generate the filenumber_lists.py
. - Check that
n_threads
at the beginning ofuniversal.py
matches the number of cores of your computer. - Run
universal.py
. - The output shows all primes the program computed, and the candidate forms, if there are any.
Three files are needed from the repo: count.cpp
, count.sh
and create_run_count.sage
. If you do not have SageMath installed, you also need run_count.sh
. How to run:
- Run
create_run_count.sage
. This will generate the filerun_count.sh
. - Make
run_count.sh
executable bychmod +x run_count.sh
- Check that
THREADS
at the beginning ofcount.cpp
matches the number of cores of your computer. - Run
run_count.sh
. - The output is in files
c_<a>_<b>_<c>_<p>.txt
. If the file contains a line withZERO <n>
, this indicates that the form<a,b,c*p>
is a candidate for a(p,l)
-universal forn
differentl
's. These candidates can be identified for instance bygrep ZERO c_*.txt
.