Skip to content

Instantly share code, notes, and snippets.

View ballpointcarrot's full-sized avatar
💭
Perpetually confused.

Christopher Kruse ballpointcarrot

💭
Perpetually confused.
View GitHub Profile
@ballpointcarrot
ballpointcarrot / primes.rb
Created April 18, 2011 04:01
A comparison between the mathn library in Ruby and a self-built solution for prime generation.
require 'mathn'
# Generates a list of primes below a given value
def primelist(n)
k = 1
a = [2,3]
while 6*k < n
a.push(6*k-1)
a.push(6*k+1)
k += 1