Cody

Problem 47558. Guess the logic

Solution 3761743

Submitted on 21 Nov 2020 by ChrisR
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 = 0; assert(isequal(logic(x),y_correct))

2   Pass
x = 2; y_correct = 188; assert(isequal(logic(x),y_correct))

3   Pass
x = 4; y_correct = 2256; assert(isequal(logic(x),y_correct))

4   Pass
x = 6; y_correct = 8460; assert(isequal(logic(x),y_correct))

5   Pass
x = 10; y_correct = 42300; assert(isequal(logic(x),y_correct))

6   Pass
x = 15; y_correct = 148050; assert(isequal(logic(x),y_correct))

7   Pass
x = 20; y_correct = 357200; assert(isequal(logic(x),y_correct))

8   Pass
x = 50; y_correct = 5757500; assert(isequal(logic(x),y_correct))

9   Pass
x = 100; y_correct = 46530000; assert(isequal(logic(x),y_correct))

10   Pass
x = 243; y_correct = 671623326; assert(isequal(logic(x),y_correct))

Suggested Problems

Community Treasure Hunt

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

Start Hunting!