in reply to Puzzle Time
First, some assumptions:
There are 9 different digits allowed, and any number having more than 9 digits will necessarily have some digits repeated. So, the upper bound is 987,654,321.
#! perl use Modern::Perl; my $count = 0; OUTER: for my $n (1 .. 987_654_321) { my %digits; ++$digits{$_} for split //, $n; for (keys %digits) { next OUTER if ($_ == 0) || ($digits{$_} > 1) || ($n % $_); } printf "#%d is %d\n", ++$count, $n; }
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|