function m = moebius3(n) v = factor(n); if any(diff(v)==0) m = 0; elseif mod(length(v), 2) m = 1; else m = -1; end end