Cody

Solution 1961320

Submitted on 6 Oct 2019 by Augusto Mazzei
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 = 1;y_correct = 1;assert(isequal(partitions(x),y_correct))

ans = 1

2   Pass
x = 5;y_correct = 7;assert(isequal(partitions(x),y_correct))

ans = 7

3   Pass
x = 50;y_correct = 204226;assert(isequal(partitions(x),y_correct))

ans = 204226

4   Pass
assert(isequal(partitions(partitions(partitions(partitions(5)))),476715857290));

ans = 7 ans = 15 ans = 176 ans = 4.7672e+11

5   Pass
assert(isequal(partitions(partitions(partitions(6))),526823));

ans = 11 ans = 56 ans = 526823

6   Pass
assert(isequal(partitions(partitions(12)),10619863));

ans = 77 ans = 10619863

7   Pass
assert(isequal(partitions(199),3646072432125))

ans = 3.6461e+12

8   Pass
P=arrayfun(@(x) partitions(x),10:10:100); y_correct=[42 627 5604 37338 204226 966467 4087968 15796476 56634173 190569292]; assert(all(isequal(P,y_correct)))

ans = 42 ans = 627 ans = 5604 ans = 37338 ans = 204226 ans = 966467 ans = 4087968 ans = 15796476 ans = 56634173 ans = 190569292