|Just another Perl shrine|
Challenge: Another Infinite Lazy Listby Limbic~Region (Chancellor)
|on Mar 17, 2005 at 20:27 UTC||Need Help??|
Limbic~Region has asked for the
wisdom of the Perl Monks concerning the following question:
In this node, tall_man asked how to generate the Hamming Sequence lazily in Perl5. I didn't understand the Haskell code and misunderstood the english explanation.
"how do you generate the series of numbers composed of a given list of prime factors, where each can be used an unlimited number of times?"
I interpreted that to mean all multiples of all prime factors provided minus duplicates were valid. My mistake was exacerbated by the fact the sample series provided fit my interpretation. I took my licks after posting an incorrect solution.
I was happy to take the downvotes and be wrong since the mistake was just as interesting to me. My challenge then is to produce R as shown below for any set of given factors lazily:
You can see my cleaned up solution below:
Cheers - L~R