Cody

Problem 240. Project Euler: Problem 6, Natural numbers, squares and sums.

Solution 1065413

Submitted on 28 Nov 2016 by suin kim
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 10; y_correct = 2640; assert(isequal(euler006(x),y_correct))

y1 = 3025 y2 = 385 y = 2640

2   Pass
x = 20; y_correct = 41230; assert(isequal(euler006(x),y_correct))

y1 = 44100 y2 = 2870 y = 41230

3   Pass
x = 200; y_correct = 401323300; assert(isequal(euler006(x),y_correct))

y1 = 404010000 y2 = 2686700 y = 401323300

Suggested Problems

More from this Author52

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!