From wikipedia:
For any positive integer n, define μ(n) as the sum of the primitive n-th roots of unity. It has values in {−1, 0, 1} depending on the factorization of n into prime factors:
Return numbers from the Mobius function sequence corresponding to the supplied indices. For example, if n = 3:7, your function should return [-1, 0, -1, 1, -1].
Hint: solving Problem 3001 and Problem 3002 will provide much of the code needed for this problem. You'll need to add prime numbers to the sphenic number set (resulting from Problem 3001).
Hello Grant. It's a nice set, but for problems 3001 and 3002 lookup tables are "always win" solutions. For this problem you can avoid this by using some randomness in the test suite.
I'm glad you like them, and thanks for the feedback. I just added a random test case to all three problems.
Yeah, the series is good. After a few rounds of spam-storm, Cody seems to be back on track...
Getting the row and column location from a matrix
196 Solvers
130 Solvers
Are all the three given point in the same line?
208 Solvers
260 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
236 Solvers