hermann on Wed, 09 Jul 2025 22:00:23 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Implementation of functions for "Integer partitions detect the primes" paper


On 2025-07-08 22:09, Bill Allombert wrote:
You should do
M1(n)=my(s=0);fordiv(n,d,s+=d);s;

But this function is just sigma(n)

Ok.

? M2(n)=s=0;for(m=1,n,forpart(v=m,if(v[1]<v[2],for(d=1,n\v[1],r=n-d*v[1];if(r%v[2]==0,s+=d*(r\v[2])))),[1,m],[2,2]));s;

As I understand this function is
(sigma(n,3)-(2*n-1)*sigma(n))/8
which is much faster to compute.

That does not work:

? M1(n)=sigma(n);
? M2(n)=(sigma(n,3)-(2*n-1)*sigma(n))/8;
? T1(n)=(n^2 - 3^n + 2)*M1(n) - 8*M2(n);
? T1(3)
-72
?

Regards,

Hermann.