/** This program counts the prime numbers less than or equal to 10^n for integer values of n. This can be used to reproduce the table at: http://mathworld.wolfram.com/PrimeCountingFunction.html */ nextExp = 1 nextNum = 10^nextExp count = 0 for p = primes[] { if p > nextNum { println["$nextExp\t$count"] nextExp = nextExp + 1 nextNum = 10^nextExp } count = count + 1 }