Information and Pre-computed Results to my Summatory Liouville Function Program

What is this?

This is a program that evaluates the summatory Liouville function up to an amount and outputs the sum along the way. The summatory Liouville function is a function that, given a natural number, for every natural number less than it: adds 1 to the sum if the number has an even number of prime factors and subtracts one if the number has an odd number of prime factors.

This function is known for its connection with the polya conjecture: where George Polya conjected that most numbers has an odd number of prime factors (sum Liouville function of negative.) This conjecture was disproved by C. Brian Haselgrove and a counterexample was found later at about 906 million by Minoru Tanaka.

Other generalizations and connections to other areas of mathmatics can be made from this function

Specifically, the results listed here are higher values of A002819

Source code

The source code is hosted on this github repo. You can improve it if you want to.

Simple, single-threaded C code.

Results

Below are the results for runs I have done. The format and data included in each file is listed below

The results are most likely correct but there may be hardware instability or bugs, which would cascade due to the nature of the program.
 • Results n ≤ 906,488,079 is certainly correct after cross referencing other sources.
 • Results n ≤ 30,040,000,000 has been calculated twice with matching results.

Summatory Liouville function sampled every 10,000,000.
Range: 0 - 33,270,000,000. Tilde (~) delimited. SHA‑256: C59E2A92388852E900FB0B5F0D36AD7E82F26004434B454A2C5338EB7D83D80F; 66,587 bytes

Zeros of the summatory Liouville function.
Range: 0 - 33,270,000,000. Tilde (~) delimited. SHA‑256: 74F1E2DDD609A500C1B1E86CDD76F391A466F948AA9296067B75B439E9C37E2A; 3,209 bytes

Summatory Liouville function for every natural number.
Range: 0 - 32,768. Tilde (~) delimited. SHA-256: 6A0DF4C344EDFAB8E829881F48CE2CCB2981031718C052A032C576CEA1D091F2; 359,394 bytes

Log file - primary run (~33.27b) 120,743 bytes
Log file - secondary run (~30.04b) 108,959 bytes

Contains timestamp. Data not sanitized.

Some graphs

The value of of the summatory Liouville function from 1e7 to 3.327e10. Sampled every 1e7
The value of of the summatory Liouville function from 1e7 to 3.327e10. Sampled every 1e7
The value of of the summatory Liouville function up to 32,768
The value of of the summatory Liouville function up to 32,768

Time complexity analysis

This analysis is made before the code was greatly optimized. Although I am pretty sure the below stated result still apply since the optimization only improved the coefficent

Using logs generated by an overnight run I made. A complexity a little better than O(n sqrt n) can be estimated. Below are two graphs that demonstrates it:

Time taken to compute and sum 10 million values
Time taken to compute and sum 10 million values, and sqrt(x) fitted to it.
Y-axis in seconds. X-axis is from 0 to 1.17 billion.
Total time taken to compute up to 1.17 billion
Total time taken to compute up to 1.17 billion fitted to n sqrt n. Y-axis in seconds.

Miscellaneous graphs

time before and after optimization
Time taken to evaluate 1e7 values before and after the 6k±1 and data types optimization.
Frequency of data. Histogram of natural log'd outputs
Frequency of data. Histogram of natural log'd outputs.
Time taken to evaluate 1e7 values in primary run. From 0 to 33.27b Time taken to evaluate 1e7 values in secondary run. From 0 to 30.04b
Time taken to evaluate 1e7 values. Primary run (top) is from 0 to 33.27b. Second run (bottom) is from 0 to 30.04b. Linear.

Actual research

This project is mainly made for fun and for me to learn the C language. I'm aware that a lot of improvements can be made. I don't plan to use the data here for anything too serious, I am just listing it here in case someone would find it useful

If you want to see some actual research about this topic and an implimentation made on a supercomputer, check out

Borwein, Peter, Ron Ferguson, and Michael Mossinghoff. "Sign changes in sums of the Liouville function." Mathematics of computation 77.263 (2008): 1681-1694.