Skip to content

Instantly share code, notes, and snippets.

@egisatoshi
Created July 8, 2013 15:03
Show Gist options
  • Save egisatoshi/5949612 to your computer and use it in GitHub Desktop.
Save egisatoshi/5949612 to your computer and use it in GitHub Desktop.
Playing with prime numbers
/home/egi/egison3% egison [130]
Egison Version 3.0.8 (C) 2011-2013 Satoshi Egi
http://egison.pira.jp
Welcome to Egison Interpreter!
> (take 5 (match-all primes (list integer) [<join _ <cons $n <cons ,(+ n 2) <cons ,(+ n 6) _>>>> [n (+ n 2) (+ n 6)]]))
{[5 7 11] [11 13 17] [17 19 23] [41 43 47] [101 103 107]}
> (take 5 (match-all primes (list integer) [<join _ <cons $n <cons ,(+ n 4) <cons ,(+ n 6) _>>>> [n (+ n 2) (+ n 6)]]))
{[7 9 13] [13 15 19] [37 39 43] [67 69 73] [97 99 103]}
>
Leaving Egison Interpreter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment