Last active
February 28, 2017 09:34
-
-
Save berdosi/dad46aa82080de58365bb059f3e5da0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* fibonacci() { var act = 1, prev = 1; while (true) { t = act; yield act = (act + prev); prev = t } } | |
// not the primes, but binary according to primality | |
function* primes(){ var n = 2; while(true) {for(var i=2;i<=Math.sqrt(n);i++) if (0==n%i) yield false, ++n; yield true, ++n} } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment