Maintenance of Ruby 2.0.0 ended on February 24, 2016. Read more
Generates all integer which are greater than 2 and are not divided by 2 nor 3.
This is a pseudo-prime generator, suitable on checking primality of a integer by brute force method.
# File prime.rb, line 352 def succ loop do if (@step) @prime += @step @step = 6 - @step else case @prime when 1; @prime = 2 when 2; @prime = 3 when 3; @prime = 5; @step = 2 end end return @prime end end