Various incomplete solutions

This commit is contained in:
FuryFire
2011-04-10 13:19:21 +02:00
parent 94dc7ec373
commit 53e3cf4358
15 changed files with 173 additions and 8 deletions

10
ProjectEuler/032/desc.yml Normal file
View File

@ -0,0 +1,10 @@
title: Find the sum of all numbers that can be written as pandigital products.
url: http://projecteuler.net/problem=32
desc: |
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, the 5-digit number, 15234, is 1 through 5 pandigital.
The product 7254 is unusual, as the identity, 39 x 186 = 7254, containing multiplicand, multiplier, and product is 1 through 9 pandigital.
Find the sum of all products whose multiplicand/multiplier/product identity can be written as a 1 through 9 pandigital.
HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.
solution: Bruteforce

View File

@ -0,0 +1,6 @@
<?php
function pandigital($number) {
$array = count_chars($number,1);
ksort($array);
if($array == array(49=>1,50=>1,51=>1,52=>1,53=>1,54=>1,55=>1,56=>1,57=>1)) { return true;} else { return false; }
}