sub t{($n,@c)=@_;my@w;foreach$c(@c){for$u(1..9) {next if$c=~/$u/;$y=$c.$u;if($y%$n==0){push(@w,$y)}}}return@w} my@c=(1..9);for$i(2..9){@c=&t($i,@c)}print"@c\n"