// Test to check isPrime using Sieve of Eratosthenes. // This is memory-limited in the highest number it can calculate. n = eval[input["Enter highest number: "]] testPrime[n] testPrime[n] := { // Initialize array array = array[0 to n] array@1 = 0 for i = 2 to ceil[sqrt[n]] if array@i != 0 for j = 2*i to n step i array@j = 0 for i = 2 to n if isPrime[i] != (array@i != 0) println["Error! n=$i Sieve=" + (array@i != 0)] }