Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Puzzle Time

by BrowserUk (Pope)
on Dec 23, 2012 at 03:59 UTC ( #1010073=note: print w/replies, xml ) Need Help??

in reply to Puzzle Time

986400 548 (Fuckup: = instead of == !)
#! perl -slw use strict; use Algorithm::Combinatorics qw[ variations ]; my @digits = 1 .. 9; my $c = 0; for my $k ( 1 .. 9 ) { my $i = variations( \@digits, $k ); while( my $aref = $i->next ) { my $n = join '', @$aref; my $dv = 0; for my $d ( @$aref ) { my $r = $n / $d; ++$dv if int( $r ) == $r; ## <<< } ++$c if $dv == @$aref; } } print $c;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010073]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2016-10-27 17:55 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (367 votes). Check out past polls.