Arggh, I went to fix a bug and accidentally deleted the whole post.
No need for modules
use strict; use warnings; my $limit = 987654321; my $magic_num = 9 * 8 * 7; my $max = int ($limit / $magic_num); my $start = $max * $magic_num; for (0..$max - 1){ my $num = $start - $magic_num * $_; next if $num =~ /[05]/; next if $num =~ /(.).*\1/; die "$num\n" }
|
---|