Re: [Jprogramming] some Miller Rabin code

2014-02-19 Thread Pascal Jasmin
] some Miller Rabin code This looks fun, and maybe even impressive. I want to be able to come back to it later, when I feel comfortable focusing on primality issues - can I convince you to put it on a J wiki page? (This does not have to be today - if you are still working through your ideas maybe

Re: [Jprogramming] some Miller Rabin code

2014-02-18 Thread Raul Miller
This looks fun, and maybe even impressive. I want to be able to come back to it later, when I feel comfortable focusing on primality issues - can I convince you to put it on a J wiki page? (This does not have to be today - if you are still working through your ideas maybe next week would have more

[Jprogramming] some Miller Rabin code

2014-02-18 Thread Pascal Jasmin
based on Roger's code (MillerRabin1)  here are a couple of variations: huo=: <. @ -:^:(0=2&|)^:a:  NB. halve until odd NB. magic numbers from http://primes.utm.edu/prove/prove2_3.html witnesses=: 4 : 0  r=. 9080191 4759123141 2152302898747 3474749600383 341550071728321x  if. y>:{:r do.    1+x ?@$