Status
Not open for further replies.

soft2050

Active Member
2,942
2010
437
0
http://projecteuler.net/
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.
Keeping it simple, you are to solve last unsolved problem posted in this thread. The first person to solve previous problem would post his/her source code. He would then post a different problem (which he himself is able to solve) for others to solve

I would try to keep this thread updated with list of problem solvers if it gets active.

Rules:
- Any programming language is allowed till the time they aren't esoteric
- No copying
- Constructive Criticism is allowed
- Maximum of 4 days time to solve after which original poster could post his solution
- You could post problem which is not from projecteuler.net, but this should not be used as a help thread

----------------------------------

To start off, solve #52: http://projecteuler.net/problem=52
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
 
2 comments
that problem 52 is gramatically vague, contains the same digits? its much better if it contains the same numbers though in different order
 
PHP:
<?php
function same_nums($num1, $num2) {
	$num1 = str_split($num1);
	$num2 = str_split($num2);
	sort($num1);
	sort($num2);
	$num1 = implode('', $num1);
	$num2 = implode('', $num2);
	if ($num1 == $num2) {
		return true;
	}
	else {
		return false;
	}
}

$i = 1;

while(true){
	if(same_nums($i,2*$i) && same_nums($i,3*$i) && same_nums($i,4*$i) && same_nums($i,5*$i) && same_nums($i,6*$i))
		break;
	else
		$i++;
}

echo $i;

?>
would give 142857

now problem #38 Pandigital multiples: http://projecteuler.net/problem=38

Take the number 192 and multiply it by each of 1, 2, and 3:

192 1 = 192
192 2 = 384
192 3 = 576
By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3)

The same can be achieved by starting with 9 and multiplying by 1, 2, 3, 4, and 5, giving the pandigital, 918273645, which is the concatenated product of 9 and (1,2,3,4,5).

What is the largest 1 to 9 pandigital 9-digit number that can be formed as the concatenated product of an integer with (1,2, ... , n) where n 1?
 
Status
Not open for further replies.
Back
Top