Jump to content

Talk:Prime numbers/Prime number generators

Page contents not supported in other languages.
Add topic
From Wikiversity
Latest comment: 2 years ago by Billymac00 in topic Prime generation in PariGP

Prime generation in PariGP

[edit source]

This script of work by Huen Yeong Kong produces the primes in order using Pari's factor command. I show it in compact form for brevity:<br>

:: \\  \r YKHuen.gp  7/13/2022\\  ref:  Huen Yeong Kong  https://gauravtiwari.org/this-prime-generating-product-factors/

:: genit(nterm)={q=prod(x=1,nterm,x);f=factor(q);v=f[,1];w=Set(v);print(w);print("max prime = ",w[#w],"   ",#w);}

Billymac00 (discusscontribs) 00:35, 15 July 2022 (UTC)Reply