Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: list doesn't end (Alexander Chen) 2. Re: list doesn't end (Francesco Ariis) 3. Re: list doesn't end (Alexander Chen) ---------------------------------------------------------------------- Message: 1 Date: Sun, 24 Nov 2019 17:10:17 +0100 (CET) From: Alexander Chen <alexan...@chenjia.nl> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] list doesn't end Message-ID: <1726437853.349004.1574611817...@ichabod.co-bxl> Content-Type: text/plain; charset="utf-8" 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 <fa...@ariis.it> wrote:Hello Alexander, On Sat, Nov 23, 2019 at 07:38:03PM +0100, Alexander Chen wrote: > 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 package. the output is: > > [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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20191124/38868b3f/attachment-0001.html> ------------------------------ Message: 2 Date: Sun, 24 Nov 2019 19:19:51 +0100 From: Francesco Ariis <fa...@ariis.it> To: beginners@haskell.org Subject: Re: [Haskell-beginners] list doesn't end Message-ID: <20191124181951.gb3...@x60s.casa> Content-Type: text/plain; charset=us-ascii On Sun, Nov 24, 2019 at 05:10:17PM +0100, Alexander Chen wrote: > 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.... If `x+y+z` need to be <50, and the three are primes, I am puzzled to see such lengths! Which problem is it? ------------------------------ Message: 3 Date: Mon, 25 Nov 2019 08:55:17 +0100 (CET) From: Alexander Chen <alexan...@chenjia.nl> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] list doesn't end Message-ID: <643030919.375007.1574668517...@ichabod.co-bxl> Content-Type: text/plain; charset="utf-8" Hi Francesco, Their is a ^2, ^3, ^4 in the lists, respectively. see https://projecteuler.net/problem=87 best, November 24, 2019 7:19:51 PM CET Francesco Ariis <fa...@ariis.it> wrote:On Sun, Nov 24, 2019 at 05:10:17PM +0100, Alexander Chen wrote: > 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.... If `x+y+z` need to be <50, and the three are primes, I am puzzled to see such lengths! Which problem is it? _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20191125/6de973df/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 137, Issue 11 ******************************************