### Comment on

 Need Help??

This horribly inefficient brute-force conversion seems like it's getting close, but needs work.

```#! perl -slw
use strict;

sub merge {
return unless @_ == 2;
return @{ \$_[1] } unless @{ \$_[0] };
return @{ \$_[0] } unless @{ \$_[1] };
my( \$x, \$y ) = ( \$_[0][0], \$_[1][0] );
return shift @{ \$_[0] }, merge( @_ ) if \$x < \$y;
return shift @{ \$_[1] }, merge( @_ ) if \$x > \$y;
shift @{ \$_[0] };
return shift @{ \$_[1] }, merge( @_ );
}

my @out;
sub genHam {
return unless @_;
my( \$x, @xs ) = @_;
return @out = merge [ 1, map{ \$_*\$x } @out ], [ genHam( @xs ) ];
}

print join'|',genHam 2, 3, 5 for 1..5;

__END__
[ 8:26:05.53] P:\test>440284
1
1|2|3|5
1|2|3|4|5|6|9|10|15|25
1|2|3|4|5|6|8|9|10|12|15|18|20|25|27|30|45|50|75|125
1|2|3|4|5|6|8|9|10|12|15|16|18|20|24|25|27|30|36|40|45|50|54|60|75|81|
+90|100|125|135|150|225|250|375|625

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?

In reply to Re: Hamming Sequences and Lazy Lists by BrowserUk
in thread Hamming Sequences and Lazy Lists by tall_man

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-06-24 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should cpanminus be part of the standard Perl release?

Results (126 votes). Check out past polls.

Notices?