my @factors = (2,3,5); # Assmue increasing sequence my $seq_len = 10; my $index = 0; foreach my $num (1..$seq_len*$factors[0]) { foreach my $factor (@factors) { unless ($num % $factor) { print "$num "; $index++; last; } } last if $index >= $seq_len; }
-Mark
In reply to Re: Challenge: Another Infinite Lazy List
by kvale
in thread Challenge: Another Infinite Lazy List
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |