20210328, 02:23  #1 
"Ed Hall"
Dec 2009
Adirondack Mtns
2×19×97 Posts 
nextprime() odd behavior?
Doesn't this seem a tiny bit odd?
Script (calling YAFU wip r395): Code:
#!/bin/bash np=2 while [ $np lt 30 ] do printf "nextprime for $np is " np=$(./yafu "nextprime($np)" silent) echo "$np" done Code:
$ bash primesgen.sh nextprime for 2 is 3 nextprime for 3 is 13 nextprime for 13 is 17 nextprime for 17 is 19 nextprime for 19 is 23 nextprime for 23 is 29 nextprime for 29 is 31 
20210329, 14:48  #2 
"Ben"
Feb 2007
D4C_{16} Posts 
Well, that was silly. Thanks as always for testing! Fixed in r396.
P.s., *cough* "primes(0,1e6,0)" pscreen *cough* 
20210329, 18:11  #3 
"Ed Hall"
Dec 2009
Adirondack Mtns
3686_{10} Posts 

20210329, 18:18  #4 
"Ben"
Feb 2007
2^{2}·23·37 Posts 
I had to look it up too . primes(0,1000000) is the same as primes(0,1000000,1) which just counts primes in the range. primes(0,1000000,0) actually computes them and pscreen dumps them to screen. pfile puts them in primes.dat.

20210329, 20:19  #5  
"Ed Hall"
Dec 2009
Adirondack Mtns
111001100110_{2} Posts 
Quote:
Thanks for all! 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
gcc 10.2.0 behavior  bsquared  Programming  11  20210117 21:55 
nextprime function is spooked by leading zero.  shortcipher  YAFU  5  20180327 13:59 
nextprime() appears to be limited...  EdH  YAFU  7  20130318 22:09 
P1, 4GB RAM on 32 bit OS, odd behavior  PageFault  Software  2  20120506 00:58 
Question about P1 behavior  JuanTutors  Software  0  20061118 02:49 