Let 'F' be the set of all proper fractions in lowest term, whose denominator is less than or equal 'd'. So, for d = 10, we have:
Note that '2/4' and '3/9' are not included because they are not in their lowest term, while '7/7' and '8/5' are not included because they are not proper fractions.
Write a function 'S(d)', which is the integer part of the sum of 'F(d)'. For the case above, the sum of elements of 'F(10)' is exactly '15.5'. Therefore S(10) = 15.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers9
Suggested Problems
-
Find the alphabetic word product
3457 Solvers
-
How long do each of the stages of the rocket take to burn?
453 Solvers
-
Calculate compression ratio of engine
218 Solvers
-
776 Solvers
-
Determine the Zeckendorf expansion of a number
14 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Could not figure out how to speed up my code. Ended up having to use a lookup table to speed it up sufficiently.
Hi,
There is a shortcut using Mobius Inversion...