Cody

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

Solution 1104049

Submitted on 14 Jan 2017 by Matteo Raso
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))

a = 0 b = 0 a = 1 b = 1 a = 5 b = 3 a = 14 b = 6 a = 30 b = 10 a = 55 b = 15 a = 91 b = 21 a = 140 b = 28 a = 204 b = 36 a = 285 b = 45 a = 385 b = 55 b = 3025 y = 2640

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

a = 0 b = 0 a = 1 b = 1 a = 5 b = 3 a = 14 b = 6 a = 30 b = 10 a = 55 b = 15 a = 91 b = 21 a = 140 b = 28 a = 204 b = 36 a = 285 b = 45 a = 385 b = 55 a = 506 b = 66 a = 650 b = 78 a = 819 b = 91 a = 1015 b = 105 a = 1240 b = 120 a = 1496 b = 136 a = 1785 b = 153 a = 2109 b = 171 a = 2470 b = 190 a = 2870 b = 210 b = 44100 y = 41230

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

a = 0 b = 0 a = 1 b = 1 a = 5 b = 3 a = 14 b = 6 a = 30 b = 10 a = 55 b = 15 a = 91 b = 21 a = 140 b = 28 a = 204 b = 36 a = 285 b = 45 a = 385 b = 55 a = 506 b = 66 a = 650 b = 78 a = 819 b = 91 a = 1015 b = 105 a = 1240 b = 120 a = 1496 b = 136 a = 1785 b = 153 a = 2109 b = 171 a = 2470 b = 190 a = 2870 b = 210 a = 3311 b = 231 a = 3795 b = 253 a = 4324 b = 276 a = 4900 b = 300 a = 5525 b = 325 a = 6201 b = 351 a = 6930 b = 378 a = 7714 b = 406 a = 8555 b = 435 a = 9455 b = 465 a = 10416 b = 496 a = 11440 b = 528 a = 12529 b = 561 a = 13685 b = 595 a = 14910 b = 630 a = 16206 b = 666 a = 17575 b = 703 a = 19019 b = 741 a = 20540 b = 780 a = 22140 b = 820 a = 23821 b = 861 a = 25585 b = 903 a = 27434 b = 946 a = 29370 b = 990 a = 31395 b = 1035 a = 33511 b = 1081 a = 35720 b = 1128 a = 38024 b = 1176 a = 40425 b = 1225 a = 42925 b = 1275 a = 45526 b = 1326 a = 48230 b = 1378 a = 51039 b = 1431 a = 53955 b = 1485 a = 56980 b = 1540 a = 60116 b = 1596 a = 63365 b = 1653 a = 66729 b = 1711 a = 70210 b = 1770 a = 73810 b = 1830 a = 77531 b = 1891 a = 81375 b = 1953 a = 85344 b = 2016 a = 89440 b = 2080 a = 93665 b = 2145 a = 98021 b = 2211 a = 102510 b = 2278 a = 107134 b = 2346 a = 111895 b = 2415 a = 116795 b = 2485 a = 121836 b = 2556 a = 127020 b = 2628 a = 132349 b = 2701 a = 137825 b = 2775 a = 143450 b = 2850 a = 149226 b = 2926 a = 155155 b = 3003 a = 161239 b = 3081 a = 167480 b = 3160 a = 173880 b = 3240 a = 180441 b = 3321 a = 187165 b = 3403 a = 194054 b = 3486 a = 201110 b = 3570 a = 208335 b = 3655 a = 215731 b = 3741 a = 223300 b = 3828 a = 231044 b = 3916 a = 238965 b = 4005 a = 247065 b = 4095 a = 255346 b = 4186 a = 263810 b = 4278 a = 272459 b = 4371 a = 281295 b = 4465 a = 290320 b = 4560 a = 299536 b = 4656 a = 308945 b = 4753 a = 318549 b = 4851 a = 328350 b = 4950 a = 338350 b = 5050 a = 348551 b = 5151 a = 358955 b = 5253 a = 369564 b = 5356 a = 380380 b = 5460 a = 391405 b = 5565 a = 402641 b = 5671 a = 414090 b = 5778 a = 425754 b = 5886 a = 437635 b = 5995 a = 449735 b = 6105 a = 462056 b = 6216 a = 474600 b = 6328 a = 487369 b = 6441 a = 500365 b = 6555 a = 513590 b = 6670 a = 527046 b = 6786 a = 540735 b = 6903 a = 554659 b = 7021 a = 568820 b = 7140 a = 583220 b = 7260 a = 597861 b = 7381 a = 612745 b = 7503 a = 627874 b = 7626 a = 643250 b = 7750 a = 658875 b = 7875 a = 674751 b = 8001 a = 690880 b = 8128 a = 707264 b = 8256 a = 723905 b = 8385 a = 740805 b = 8515 a = 757966 b = 8646 a = 775390 b = 8778 a = 793079 b = 8911 a = 811035 b = 9045 a = 829260 b = 9180 a = 847756 b = 9316 a = 866525 b = 9453 a = 885569 b = 9591 a = 904890 b = 9730 a = 924490 b = 9870 a = 944371 b = 10011 a = 964535 b = 10153 a = 984984 b = 10296 a = 1005720 b = 10440 a = 1026745 b = 10585 a = 1048061 b = 10731 a = 1069670 b = 10878 a = 1091574 b = 11026 a = 1113775 b = 11175 a = 1136275 b = 11325 a = 1159076 b = 11476 a = 1182180 b = 11628 a = 1205589 b = 11781 a = 1229305 b = 11935 a = 1253330 b = 12090 a = 1277666 b = 12246 a = 1302315 b = 12403 a = 1327279 b = 12561 a = 1352560 b = 12720 a = 1378160 b = 12880 a = 1404081 b = 13041 a = 1430325 b = 13203 a = 1456894 b = 13366 a = 1483790 b = 13530 a = 1511015 b = 13695 a = 1538571 b = 13861 a = 1566460 b = 14028 a = 1594684 b = 14196 a = 1623245 b = 14365 a = 1652145 b = 14535 a = 1681386 b = 14706 a = 1710970 b = 14878 a = 1740899 b = 15051 a = 1771175 b = 15225 a = 1801800 b = 15400 a = 1832776 b = 15576 a = 1864105 b = 15753 a = 1895789 b = 15931 a = 1927830 b = 16110 a = 1960230 b = 16290 a = 1992991 b = 16471 a = 2026115 b = 16653 a = 2059604 b = 16836 a = 2093460 b = 17020 a = 2127685 b = 17205 a = 2162281 b = 17391 a = 2197250 b = 17578 a = 2232594 b = 17766 a = 2268315 b = 17955 a = 2304415 b = 18145 a = 2340896 b = 18336 a = 2377760 b = 18528 a = 2415009 b = 18721 a = 2452645 b = 18915 a = 2490670 b = 19110 a = 2529086 b = 19306 a = 2567895 b = 19503 a = 2607099 b = 19701 a = 2646700 b = 19900 a = 2686700 b = 20100 b = 404010000 y = 401323300