primep matter



hello,
I have this to report:

1) primep(2^31-1) hangs. I don't see why. Given separately, lines from 
(defun pripmep...) (see rat3c.lisp) work fine. For other powers (... 29, 
30, 32,...) it works fine.
2) (defun primep...) tries to factor its argument which is very slow.
3) faster algorithhm is easily introducible: just load primeq.lisp from 
Prof. Fateman's MockMathematica, and add (define jacobi-symbol(p q) 
(JacobiSymbol p q)) line. this can be put to share/, or even replace 
native maxima's primep() in rat3c.lisp.
4) MocksMMA's primeq(2^98765-1) causes frame stack overflow.
5) 2^98765-1 is processed in the twinkling of an eye with GMP's 
mpz_probab_prime_p() function (I tested with a separate C program).

I worked with maxima 5.9.0 + gcl 2.5.2. It is possible that statements 
1) and 4) aren't true with the current CVS maxima. Anyway, the fifth 
statement is connected  with another discussion in this list. Recall the 
list processing routins in maxima question. Should maxima have wrappers 
for useful lisp functions? Here it's one more layer down: GCL uses GMP 
library which has some useful function; GCL doesn't provide this 
function; how can the function be accessed at the Maxima level?

--
Andrei Zorine