Greetings!
Wolfgang Jenkner <wjenkner@inode.at> writes:
> Andrei Zorine <zoav1@uic.nnov.ru> writes:
>
> > 1) primep(2^31-1) hangs.
>
> Not on SBCL or CLISP.
>
Nor on my recent maxima 5.9.0 build atop gcl 2.6.1.
> > 2) (defun primep...) tries to factor its argument which is very slow.
>
> Only if a pseudo-prime test (in a weak sense) is passed. In the worst
> case (if the argument N is actually a prime) CFACTOR performs
> sqrt(N)/3+O(1) trial divisions. There was a similar discussion some
> time ago in the thread starting with
>
> http://www.math.utexas.edu/pipermail/maxima/2002/001979.html
>
> But I think that Camm fixed that (GCL-) bug.
>
Should be fixed to my knowledge.
Take care,
> > 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.
>
> Maxima has $JACOBI.
>
> Wolfgang
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
>
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah