Skip to content

Instantly share code, notes, and snippets.

@jonelf
Created April 11, 2012 08:25
Show Gist options
  • Save jonelf/2357864 to your computer and use it in GitHub Desktop.
Save jonelf/2357864 to your computer and use it in GitHub Desktop.
Project Euler one-liner
require'prime';s=500;n=s*(s+1)/2;i=s+1;while(n.prime_division.transpose[1].map{|n|n+1}.reduce(&:*)<s);n+=i;i+=1;end;n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment