All pastes #1420264 Raw Edit

Miscellany

public text v1 · immutable
#1420264 ·published 2009-05-12 09:32 UTC
rendered paste body
# Euler problem 52
use strict;
my $x = 1;
my $i;
my $str;
my $finished = 0;
while ($finished == 0)
{
    $str = join('',sort(split("","$x")));
    if ($str == join('',sort(split('',2*$x.""))) &&
        $str == join('',sort(split('',3*$x.""))) &&
        $str == join('',sort(split('',4*$x.""))) &&
        $str == join('',sort(split('',5*$x.""))) &&
        $str == join('',sort(split('',6*$x.""))))
    {
        for ($i = 1;$i <= 6;$i++)
        {
            print $i . "x = " . $i*$x . "\n";
        }
        $finished = 1;
    }
    $x++;
}