Problem 42936. Project Euler: Problem 11, Largest product in a grid
Solution Stats
Problem Comments
-
9 Comments
The md5.update() seems to be broken. I ran the following code in the scratch pad.
------------------------------------------
md5.update(typecast(uint64(PE11(magic(10),4)),'uint8'))
assert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...
'9260342934CE67F6A3E74F7EF9001460'))
------------------------------------------------
Then the output is as follows:
Unable to resolve the name 'md5.update'.
@Dong-hyun: there was a problem with the test suite hiding code from the solve page. There was setup code that was being suppressed from view, but was being run before each of the tests. Accordingly, the problem was still solvable, but could not be tested via the Scratch Pad.
I have copied the necessary setup code into each test case, so it should work for you now.
Note that the "rng default" line is needed for the first test case (as is included there) but not for the other two test cases (and is, therefore, not included there).
And, to clarify my comment regarding the Scratch Pad, the test cases need to be present in the Scratch Pad in the same order, due to the reliance upon seeding the random-number generation. I would recommend copying in all three in order before testing your solution.
Solution Comments
Show commentsGroup

Project Euler II
- 12 Problems
- 51 Finishers
- Sums of cubes and squares of sums
- Sum of big primes without primes
- Project Euler: Problem 11, Largest product in a grid
- Highly divisible triangular number (inspired by Project Euler 12)
- Divisors for big integer
- Large Sum (inspired by Project Euler 13)
- Longest Collatz Sequence
- Project Euler: Problem 16, Sums of Digits of Powers of Two
- Project Euler: Problem 18, Maximum path sum I
- Recurring Cycle Length (Inspired by Project Euler Problem 26)
- Numbers spiral diagonals (Part 1)
- Numbers spiral diagonals (Part 2)
Problem Recent Solvers99
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!