Cody

Solution 579471

Submitted on 11 Feb 2015 by Sylvain
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% n = 1:5; arr_corr = [1, -1, -1, 0, -1]; assert(isequal(mobius_func_seq(n),arr_corr))

2   Pass
%% n = 1:10; arr_corr = [1, -1, -1, 0, -1, 1, -1, 0, 0, 1]; assert(isequal(mobius_func_seq(n),arr_corr))

3   Pass
%% n = 3:7; arr_corr = [-1, 0, -1, 1, -1]; assert(isequal(mobius_func_seq(n),arr_corr))

4   Pass
%% n = 20:30; arr_corr = [0 1 1 -1 0 0 1 0 0 -1 -1]; assert(isequal(mobius_func_seq(n),arr_corr))

5   Pass
%% n = 1:77; arr_corr = [1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0, 1, -1, -1, 0, 1, -1, -1, 0, -1, 1, 0, 0, 1]; assert(isequal(mobius_func_seq(n),arr_corr))