Skip to content

Instantly share code, notes, and snippets.

@zhuomingliang
Created March 1, 2012 14:51
Show Gist options
  • Save zhuomingliang/1950259 to your computer and use it in GitHub Desktop.
Save zhuomingliang/1950259 to your computer and use it in GitHub Desktop.
primes
constant @primes = 2, 3, -> $p { ($p+2, $p+4 ... -> $n { $n %% none @primes ... * >= sqrt $n })[*-1] } ... *; say @primes[^20];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment