Cody

Problem 1742. Generate a Parasitic Number

Solution 2075028

Submitted on 31 Dec 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   Fail
n=4;k=7;y_correct='179487'; assert(isequal(generate_parasitic(k,n),y_correct))

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test1 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

2   Fail
n=7;k=4;y_correct='0579710144927536231884'; assert(isequal(generate_parasitic(k,n),y_correct))

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test2 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

3   Fail
n=2;k=6;y_correct='315789473684210526'; assert(isequal(generate_parasitic(k,n),y_correct))

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test3 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

4   Fail
n=5;k=7;y_correct='142857'; assert(isequal(generate_parasitic(k,n),y_correct))

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test4 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

5   Fail
n=1;k=3;y_correct='3'; assert(isequal(generate_parasitic(k,n),y_correct))

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test5 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

6   Fail
n=6;k=6;y_correct='1016949152542372881355932203389830508474576271186440677966' assert(isequal(generate_parasitic(k,n),y_correct))

y_correct = '1016949152542372881355932203389830508474576271186440677966'

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test6 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

7   Fail
n=9;k=6;y_correct='06741573033707865168539325842696629213483146' assert(isequal(generate_parasitic(k,n),y_correct))

y_correct = '06741573033707865168539325842696629213483146'

Undefined function 'generate_parasitic' for input arguments of type 'double'. Error in Test7 (line 2) assert(isequal(generate_parasitic(k,n),y_correct))

Community Treasure Hunt

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

Start Hunting!