use strict; use warnings; use Algorithm::Permute qw( permute ); use Math::Combinatorics qw( combine ); my @arr = reverse 1 .. 9; foreach my $n ( @arr ) { my $last = 0; foreach my $arr ( combine( $n, @arr ) ) { my @v = @$arr; permute { my $v = 1; $v *= $_ for @v; if ( (my $w = join('',@v)) % $v == 0 ) { print "$w\n"; $last = 1; } } @v; } last if $last; }
In reply to Re: Puzzle: What is the largest integer whose digits are all different (and do not include 0) that is divisible by each of its individual digits?
by dragonchild
in thread Puzzle: What is the largest integer whose digits are all different (and do not include 0) that is divisible by each of its individual digits?
by tphyahoo
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |