Cody

Problem 43037. Non trivial identities - summation

Solution 1329578

Submitted on 6 Nov 2017 by Jean-Marie Sainthillier
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
for k=1:20 x=randperm(k); assert(isequal(identity(x),x)); end assert(~isempty(strfind(fileread('identity.m'), '+')),'use +')

ans = 1 ans = 2 1 ans = 3 1 2 ans = 3 2 4 1 ans = 1 5 2 3 4 ans = 1 4 5 3 6 2 ans = 2 3 6 1 7 5 4 ans = 7 6 8 3 2 1 4 5 ans = 6 8 5 4 7 3 9 1 2 ans = 1 2 6 10 7 5 9 4 3 8 ans = 6 4 2 7 8 5 9 11 10 1 3 ans = 10 2 12 3 5 4 9 1 11 7 6 8 ans = 2 7 11 5 3 1 6 9 8 4 12 13 10 ans = 7 10 8 3 2 14 9 5 13 11 1 12 6 4 ans = 5 3 8 12 4 1 13 15 14 11 6 10 7 2 9 ans = 5 6 16 10 9 8 12 1 2 14 3 7 11 13 15 4 ans = 15 2 13 16 10 6 7 11 17 12 5 3 8 14 4 1 9 ans = 11 15 6 8 12 1 16 14 10 4 2 13 3 7 18 17 5 9 ans = 2 1 14 4 10 5 12 16 11 9 6 19 18 8 13 7 3 15 17 ans = 1 6 15 5 20 2 7 11 12 18 3 19 13 10 14 9 4 8 17 16

Suggested Problems

More from this Author14

Community Treasure Hunt

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

Start Hunting!