The radical of a positive integer x is defined as the product of the distinct prime numbers dividing x. For example, the distinct prime factors of
is
, therefore the radical of
is
. Similarly, the radicals of
,
and
are
, 5 and
, respectively, The number1is considered to be the radical of itself.
Given a limit n, find the sum of the radicals of all positive integers
.
For
, the radicals are:
. Therefore, the output should be '41'.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
Swap the first and last columns
23269 Solvers
-
3825 Solvers
-
1750 Solvers
-
The Hitchhiker's Guide to MATLAB
3428 Solvers
-
Unique values without using UNIQUE function
457 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!