Ad
  • Default User Avatar

    Are we really testing programming anymore?
    Runtime performance is an advanced topic.

  • Default User Avatar

    I special cased the loop increment to 2 after
    a threshold and doubled the number of random number
    evaluations from 30 to 60 but still times out.

    Looking at primes from 1..100 shows 25 primes with
    prime gap deltas of 2,4,6,8. I am not sure how to be
    systematic in this effort. Is there a paper someone
    can direct me to?

    Richard
    This is approximately logarithmic?

  • Default User Avatar

    My solutions either run into memset (bool) space or runtime exceeded.
    The straightforward wiki dfn causes runtime exceeded (attached below).

    My for loop upper bound increment is i++.
    Maybe it can be dynamically trimmed to avoid
    visiting multiples of existing primes?

    **Is that the right direction towards a solution? **

    Random_Test

    1 num:876527174 .. is not prime! 21 num:1577810551 .. is not prime!
    2 num:1644030750 .. is not prime! 22 num:1266333403 .. is not prime!
    3 num:1393969603 .. is not prime! 23 num:2132127515 .. is not prime!
    4 num:1335491684 .. is not prime! 24 num:1281074547 .. is not prime!
    5 num:1929713169 .. is not prime! 25 num:90046948 .. is not prime!
    6 num:24193965 .. is not prime! 26 num:2068897426 .. is not prime!
    7 num:49651675 .. is not prime! 27 num:1737718634 .. is not prime!
    8 num:218588094 .. is not prime! 28 num:714922702 .. is not prime!
    9 num:356028242 .. is not prime! 29 num:162692740 .. is not prime!
    10 num:877418047 .. is not prime! 30 num:587217759 .. is not prime!
    11 num:901310737 .. is not prime! 31 num:869667984 .. is not prime!
    12 num:1107801141 .. is not prime! 32 num:1039219915 .. is not prime!
    13 num:2099772465 .. is not prime! 33 num:83764861.. IS prime!
    14 num:993022361 .. is not prime! 34 num:116153939 .. is not prime!
    15 num:503688437 .. is not prime! 35 num:227227951 .. is not prime!
    16 num:735156648 .. is not prime!
    17 num:1089112823.. IS prime!
    18 num:914354483 .. is not prime!
    19 num:390465283 .. is not prime! STDERR
    20 num:1819589577 .. is not prime! Execution Timed Out (12000 ms)