Prime Count and Addition Chains

Zhi-Wei Sun (maths.nju.edu.cn/~zwsun) in 2015 conjectured that a certain sequence of prime counts would be an addition chain A262439. If we define this function:

\(f(n)=\pi\left(\frac{n(n+1)}{2}+1\right)\)

where \(\pi(x)\) is the number of primes \(\le x\), then:

\(f(x)=\begin{cases}1 \text{  if }x=1\\f(y)+f(z) \text{  }1\le y,z<x\end{cases}\).

Zhi-Wei Sun then strengthened the conjecture A262446 to say that all but the first few steps are non-doubling steps:

\(f(x)    =\begin{cases}
1  \text{  if }x=1\\f(y)+f(z)  \text{  if }x\le3,1\le y,z<x\\f(y)+f(z) \text{  } 1\le y<z<x\end{cases}\)

Sun validated this conjecture for all \(n\le 10^5\) in 2015. Chang Zhang then further validated \(n\le 5\times 10^5\) in 2020.

In 2024 I checked the conjecture for \(n\le 2^{24} \). I used primecount write out the \(f(n)\) values for each \(n\). Then I processed the file to make sure it was an addition chain.

The raw file with 64 bit entries is here for (\(n\le 2^{21}\)): 

primePiValues.bin.gz

In order to get the processing to work fast you had to realize that this addition chain grows quite slowly in comparison to near optimum chains. This chain is full of extreme non-star steps.

Since \(\lim_{n\rightarrow\infty}\frac{f(n+1)}{f(n)}=1\) we must get blocks of larger and larger sequences of small steps. \(\lim_{n\rightarrow\infty}f(n+1)-f(n)=\infty\) so the addition chain elements keep growing by larger gaps.

I show the non-star steps in the following table getting bigger as we find new larger cases. We have \(f(x)=f(y)+f(z)\):

\(x\) \(y\) \(z\)
120921 104372 57732
150709 126914 77238
217810 190435 100048
246024 217622 108433
257565 228797 111705
292458 258904 128622
322461 288484 136024
360939 322973 152215
363256 306523 185953
501427 443185 222464
558272 486334 260771
681217 607438 292381
686734 572580 363154
877591 693121 518832
1981699 1731735 920666
2063798 1794016 975766
2399898 2112064 1088588
2627968 2193299 1392603
3662051 3214021 1679738
4074045 3621032 1784005
4114800 3453800 2153179
5256799 4566383 2498698
6953359 6108085 3185932
7872428 6973453 3499933
8459842 7419938 3899478
10609205 9522038 4476848
11078697 9932948 4696731
12454304 11224993 5161959
13617461 12371920 5437331
14048075 12506510 6135538
15508748 13785480 6816960