1 # The Computer Language Shootout
2 # http://shootout.alioth.debian.org/
4 # contributed by Glenn Parker, March 2005
5 # modified by Evan Phoenix, Sept 2006
26 n = 9 # (ARGV[0] || 2).to_i
27 Flags = ("\x1" * ( 2 ** n * 10_000)).unpack("c*")
29 n.downto(n-2) do |exponent|
31 m = (1 << exponent) * 10_000
32 # m = (2 ** exponent) * 10_000
34 printf "Primes up to %8d %8d\n", m, count