Cody

Solution 1697408

Submitted on 20 Dec 2018 by Osman
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
n=7;p=2;y=biggest_power(n,p) assert(isequal(y,12));

y = 12

2   Pass
n=30;p=4;y=biggest_power(n,p) assert(isequal(y,60480));

y = 60480

3   Pass
n=25;p=11;y=biggest_power(n,p) assert(isequal(y,4));

y = 4

4   Pass
n=1000;p=100;y=biggest_power(n,p) assert(isequal(y,7257600));

y = 7257600

5   Pass
s=0; p=10; for n=100:-1:20 s(n-19)=biggest_power(n,p); end assert(isequal(sum(s),79641800)); assert(isequal(numel(unique(s)),13)); assert(isequal(floor(mean(s)),983232));

6   Pass
n=100; s=0; for p=30:-1:10 s(p-9)=biggest_power(n,p); end assert(isequal(sum(s),14825664)); assert(isequal(numel(unique(s)),7)); assert(isequal(floor(mean(s)),705984));

Suggested Problems

More from this Author80