• Checking primality of large numbers

    From William Unruh@21:1/5 to William Unruh on Wed Nov 4 18:27:57 2015
    On 2015-11-04, William Unruh <unruh@invalid.ca> wrote:
    On 2015-11-04, Rainer Rosenthal <r.rosenthal@web.de> wrote:
    For a problem in recreational math I am testing numbers of
    magnitude around 10^1400 whether they are prime or not.
    It takes about two and half an hour per number when I use
    the standard isprime() Funktion.

    Are there ways inside Maple (I use V) to get the results faster?

    That is fast. Remember that if you were to try testing primality by
    division it would take many many many times longer than that age of the universe. There exist probabilistic primality tests-- depends on how
    much probablility you are willing to accept that the number is reported
    as prime but is really not. (the probabillies are verysmall) There is
    also a deterministic polynomial time test. But I think the polynomial is quite large.Wikipedia suggests about l^6.

    I do not know what Maple uses in the isprime() function.

    Always helps to read the documentation. Doing ? isprime, it tells me it
    uses a probabilistic primality tester, but not which one. There is thus
    a very small probability that it will say the number is prime when it is
    not. The probability of your computer being hit by a meteor is probably larger than that probability. Probablilistic tests are about as fast as they
    get. Remember also that large number ( and you are using at least 1500
    digit arithmetic) is also very slow.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Rosenthal@21:1/5 to All on Wed Nov 4 15:20:44 2015
    For a problem in recreational math I am testing numbers of
    magnitude around 10^1400 whether they are prime or not.
    It takes about two and half an hour per number when I use
    the standard isprime() Funktion.

    Are there ways inside Maple (I use V) to get the results faster?

    Wolfram Alpha doesn's accept large numbers like that without
    fee. Are there any sources in the web accepting large numbers
    that are free and reliable?

    Cheers,
    Rainer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Unruh@21:1/5 to Rainer Rosenthal on Wed Nov 4 17:34:02 2015
    On 2015-11-04, Rainer Rosenthal <r.rosenthal@web.de> wrote:
    For a problem in recreational math I am testing numbers of
    magnitude around 10^1400 whether they are prime or not.
    It takes about two and half an hour per number when I use
    the standard isprime() Funktion.

    Are there ways inside Maple (I use V) to get the results faster?

    That is fast. Remember that if you were to try testing primality by
    division it would take many many many times longer than that age of the universe. There exist probabilistic primality tests-- depends on how
    much probablility you are willing to accept that the number is reported
    as prime but is really not. (the probabillies are verysmall) There is
    also a deterministic polynomial time test. But I think the polynomial is
    quite large.Wikipedia suggests about l^6.

    I do not know what Maple uses in the isprime() function.


    Wolfram Alpha doesn's accept large numbers like that without
    fee. Are there any sources in the web accepting large numbers
    that are free and reliable?

    Cheers,
    Rainer






    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Luschny@21:1/5 to All on Wed Nov 4 11:28:26 2015
    Am Mittwoch, 4. November 2015 15:20:53 UTC+1 schrieb RR:

    For a problem in recreational math I am testing numbers of
    magnitude around 10^1400 whether they are prime or not.
    It takes about two and half an hour per number when I use
    the standard isprime() Funktion.

    Are there ways inside Maple (I use V) to get the results faster?

    Well, if your computer is as old as Maple V (which is from the
    last millennium) you probably have no chance to speed this up.

    With an Intel i7-2600 3.4GHz, a nice OS like Linux 64-bit and
    free software like Primo this takes about 10 minutes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)