PrimeTest

This model tests whether a number, specified in the "Number" parameter, is prime or not. If it is, a true value is output to the Display; otherwise, false is output. The Ramp outputs an increasing sequence of numbers starting from 2. For each number, the Accumulator generates a sequence of its multiples, up to the value of the "Number" parameter. If the "Number" parameter can be divided by the accumulated value, then it is not prime. Otherwise, a signal is sent to the Backtrack actor to roll back the state of the Accumulator, which records the current accumulated value. The same signal is also sent to the Ramp to trigger the output of the next number.

PrimeTest is available in two formats:

See Web Start Help for details.