Created
March 23, 2024 11:11
-
-
Save Hermann-SW/b373c166d3a9e35253f3f4eab020b002 to your computer and use it in GitHub Desktop.
Analyze Proth prine k*2^m+1 (odd k < 2^m, m≥1) distribution of "k"s for a given 1≤m≤20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
P=extern("curl -s https://oeis.org/A080076/a080076.json.txt"); | |
p2=eval(getenv("p2")); | |
r=eval(getenv("r")); | |
doit(r)={ | |
for(m=r[1],r[2], | |
cnt=Vec(0,2^p2); | |
foreach(P,p,if(2^m<p&&p<2^(2*m),cnt[1+(p>>m)>>(m-p2)]++)); | |
print(m," ",cnt," (0..",2^(p2)-1,") vecsum=",vecsum(cnt)); | |
) | |
}; | |
doit(r); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With C set to this array of length 2^p2==1024 for m=20 ...
... this command draws diagram to reveal more of the Proth prime k frequency distribution for m=20:
The bottom line is x-axis for 1024 buckets, y-axis is number of "k"s falling into each bucket.
The other horizontal straight lines indicate 4^i steps of frequency.