Cody

Problem 42830. Hilbert numbers

Solution 2614672

Submitted on 26 Jun 2020
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 = 3; h_correct = 0; assert(isequal(hilbertnum(n),h_correct))

2   Fail
n = 5; h_correct = 1; assert(isequal(hilbertnum(n),h_correct))

Assertion failed.

3   Fail
n = 45; h_correct = [5 9]; assert(isequal(hilbertnum(n),h_correct))

Assertion failed.

4   Pass
n = 1169; h_correct = 1; assert(isequal(hilbertnum(n),h_correct))

5   Fail
n = 441; h_correct = [9 21 49]; assert(isequal(hilbertnum(n),h_correct))

Assertion failed.

6   Pass
n = 45678; h_correct = 0; assert(isequal(hilbertnum(n),h_correct))

7   Pass
n = 56789; h_correct = [109 521]; assert(isequal(hilbertnum(n),h_correct))

8   Pass
n = 353535; h_correct = 0; assert(isequal(hilbertnum(n),h_correct))

9   Fail
n = 35353549; h_correct = [49 77 613 749 1177 30037 47201 57673 459137 721501]; assert(isequal(hilbertnum(n),h_correct))

Assertion failed.

Community Treasure Hunt

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

Start Hunting!