Created
March 20, 2014 17:08
-
-
Save nkoneko/9668855 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
import itertools as I | |
import functools as F | |
import operator as O | |
FROM=3 | |
TO=117 | |
_=lambda m,f,g:I.cycle(I.chain(I.repeat(g,m-1),[f])) | |
_id=lambda x:x | |
_th=lambda x:x+2 | |
_fv=lambda x:x+4 | |
a=_(3,_th,_id) | |
b=_(5,_fv,_id) | |
result = F.reduce(O.add,I.islice((_b(_a(1))%6 for (_a,_b) in I.izip(a,b)),FROM-1,TO)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment