
Hi,
I am doing some further learning with euler now in Haskell instead of Julia. But I am getting something strange.
[x+y+z | x <- a2, y <- b3, z <- c4, (x+y+z) < 50]
a2, b3, c4 are all finite lists derived from the lazy list of the primes
Hi Francesco,
length a2 = 7072
length b3 = 7072
length c4 = 82
I suspect its the first two that get it into trouble. Is is 7072*7072*82 = 41014081088 permutations, 100*3 = 1000000.
So I am guessing that this is not the fix to the euler problem....
best.
November 23, 2019 8:05:32 PM CET Francesco Ariis
[28,47,33,49
λ> :m Data.Numbers.Primes λ> let a = take 100 primes λ> length [x+y+x | x <- a, y <- a, z <- a, (x+y+z) < 50] 942 I suspect one in [a2, b3, c4] is infinite (or very very long). Can you paste the whole calculation? -F _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners