Compute a sum involving the totient over divisors of a number - MATLAB Cody - MATLAB Central

Problem 52085. Compute a sum involving the totient over divisors of a number

Difficulty:Rate
Write a function to compute the following sum:
y = sum_(d|n) (-1)^(n/d) phi(d)
where phi(d) is the totient function. The sum is computed over the divisors of n (including 1 and n). The input to the function will be two limits a and b. Compute y for a <= n <= b.

Solution Stats

90.0% Correct | 10.0% Incorrect
Last Solution submitted on Oct 11, 2022

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
1
3

Problem Recent Solvers6

Suggested Problems

More from this Author298

Community Treasure Hunt

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

Start Hunting!
Go to top of page