Leading the way to the Future
Welcome Guest, Login!
13 Aug 2010 07:35:05 am by Weregoose
(Details) – Had I done this during high school when I first attempted it, I would have considered it my magnum opus...

This is valid for numbers up to 9,080,191. More testing (and maybe further optimizing) after I get some sleep.

Ans→C
For(T,0,1
C-1→S
Repeat fPart(S
1→X
42T+31→Y
.5S→S
Ans→B
While Ans
If fPart(.5Ans
round(CfPart(XY/C),0→X
round(CfPart(Y[font=verdana]²
/C),0→Y
int(.5B→B
End
If X+1=C or X=1
[font=times new roman]π→S
End
AnsfPart(.5C) or max(C={2,31,73
If Ans
End
Ans
13 Aug 2010 11:03:05 am by thornahawk
Looks great! I've been trying to figure out how to do Solovay-Strassen and the Lucas pseudoprime tests properly myself.

Speaking of which, there's also an implementation of Miller-Rabin in http://www.jjj.de/fxt/fxtpage.html (get the PDF of the book there); you might be able to pick up something useful.

thornahawk
13 Aug 2010 07:17:08 pm by Weregoose
(PDF)

I tried the {2,299417} pair to get an upper limit of 19,471,033; unfortunately, rounding matters chewed it up and spat out wrong results, so I'll have to keep the bases small. {2,7,61} looks to be fairly popular on the interwebs – I'll modify the code above and test it out. Though, if I'll be having the calculator take up time with more passes, then I'll just go all-out and get that 1012 I've been aiming for. I'll just go with these three bases first.

[EDIT]

Hmm... Drat.

For(T,0,1For(T,0,2
42T+31→Y2+int(.28[font=times new roman]×[font=arial]√T5→Y
C={2,31,73C={2,7,61

Those should have cut it. 4,759,123,129 is erroneously marked as composite. (Not even 10,135,421 works...)

Moving forward.