Cody

# Problem 45193. Fun with permutations

Solution 2512490

Submitted on 10 Jun 2020 by jmac
• Size: 30
• This is the leading solution.
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 = 4; y_correct = 10; assert(funWithPerms(N) == y_correct);

2   Pass
N = 6; assert(prod(unique(factor(funWithPerms(N)))) == 38);

3   Pass
N = 8; assert(prod(unique(factor(funWithPerms(N)))) == 382);

4   Pass
N = 10; assert(prod(unique(factor(funWithPerms(N)))) == 2374);

5   Pass
N = 12; assert(prod(unique(factor(funWithPerms(N)))) == 35038);

6   Pass
N = 14; assert(prod(unique(factor(funWithPerms(N)))) == 298810);

7   Pass
N = 16; assert(prod(unique(factor(funWithPerms(N)))) == 5775842);

8   Pass
N = 18; assert(prod(unique(factor(funWithPerms(N)))) == 62332114);

9   Pass
N = 20; assert(prod(unique(factor(funWithPerms(N)))) == 1484916506);

### Community Treasure Hunt

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

Start Hunting!