Cody

# Problem 44747. Exponents in Factorials

Solution 1956729

Submitted on 2 Oct 2019
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
assert(isequal(maxexp(5,2),3))

2   Pass
assert(isequal(maxexp(9,3),4))

3   Fail
assert(isequal(maxexp(10,14),1))

Assertion failed.

4   Pass
q=arrayfun(@(x) maxexp(x,13),2:12); assert(all(q==0))

5   Pass
assert(isequal(maxexp(67,2),64))

6   Fail
assert(isequal(maxexp(10,4),4))

Assertion failed.

7   Fail
s1=maxexp(100,3); s2=maxexp(200,5); assert(isequal(maxexp(s2,s1)-maxexp(s1,s2),maxexp(100,13)+1))

Assertion failed.

8   Fail
v=zeros(1,99); for a=2:100 v(a-1)=maxexp(100,a); end assert(isequal(sum(v==1),10)) assert(isequal(sum(find(v==2)),496)) assert(isequal(sum(v),1299)) assert(isequal(max(v)-min(v),96))

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!