Mine
public text v1 · immutable#!/usr/bin/perl -w
for ($h = 1; print "$h\n"; map {$h = shift @{$l{$_}} if $l{$_}[0] == $t[0]} keys %l) {
map {push @{$l{$_}}, $_ * $h} (2, 3, 5) and @t = sort {$a <=> $b} map $l{$_}[0], keys %l;
}
# Matthias Dallmeier