Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
go ahead... be a heretic
 
PerlMonks  

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


Comment on Re: Puzzle Time
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (16)
As of 2014-04-17 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (448 votes), past polls