Seems to need -mavx2 to really go to town with 64 bit: https://godbolt.org/g/6EFYeY
131 karma · joined April 15, 2014
An interesting historical document though.
X = 10**3
print X**16//(X*X-X-1)
# 1001002003005008013021034055089144233377610
It's like a sideways addition version of the standard Haskell lazy list version: fib = 0 : 1 : zipWith (+) fib (tail fib) import Data.List
queens n = q [] [0..n-1] where
q s [] = [[]]
q s as = concatMap (\a -> q (a:s) (delete a as)) (filter (f 1 s) as)
f _ [] a = True
f n (b:s) a = a /= b+n && a /= b-n && f (n+1) s a
main = print $ length (queens 8)
Undoubtedly functional, the question is whether it is improved eg. by using folds instead of explicit recursion, or replacing concatMap with monadic join. queens n = q n n [[]] where
q 0 m ss = ss
q n m ss = q (n-1) m (concatMap (\s->(map (:s)(filter (f 1 s) [0..m-1]))) ss)
f _ [] a = True
f n (b:s) a = a /= b && a /= b+n && a /= b-n && f (n+1) s a
main = print $ queens 8Magdalene has a interesting modern dial too.
http://www.queens.cam.ac.uk/life-at-queens/about-the-college...
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux....
Looks to me like OpenSSL caches the modulus for Montgomery multiplication and that's where the primes in higher memory are coming from (see rsa_eay.c around line 774).