This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 13 Aug 2010 07:35:05 am    Post subject:

(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


Last edited by Guest on 13 Aug 2010 07:47:45 am; edited 1 time in total
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 13 Aug 2010 11:03:05 am    Post subject:

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
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 13 Aug 2010 07:17:08 pm    Post subject:

(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.

Last edited by Guest on 13 Aug 2010 07:45:11 pm; edited 1 time in total
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement