Let me start with a big thank you to all who have contributed to Project Euler. I am 70 years old and started programming in C++ last November. The Project Euler problems have provided a strong stimulus and motivation and I have learned much that I would not have, otherwise.
Now my first issue. Problem 124 provides this definition.
The radical of n, rad(n), is the product of distinct prime factors of n.
In the problem's example, rad(1) is given to have a value of 1. How does that come from the definition?
It would seem that a better definition would be: rad(1) = 1. If n is prime, rad(n) = n. For all other natural numbers n, rad(n) is the product of the distinct prime factors of n.
(Note the use of the. Without it, one could interpret rad(180) to have several different values, 6, 10, 15, and/or 30, all of which are products of distinct prime factors of 180. One might also include 2, 3, and 5, since the current wording doesn't require any multiplication to form a product.)
I'm sure the current wording has cause no problems, but doesn't measure up to the high caliber that I have become accustomed to seeing.
Problem 124
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
TripleM
- Posts: 384
- Joined: Fri Sep 12, 2008 3:31 am
Re: Problem 124
In mathematics a product of an empty set is defined to be equal to 1: https://en.wikipedia.org/wiki/Empty_product
For someone unaware of this, rad(1) is specifically provided in the table so there shouldn't be any room for misunderstanding.
I agree an extra 'the' would probably be marginally better English, but again you would be hard pressed to say the current version is incorrect or able to be misunderstood given the numerous examples.
For someone unaware of this, rad(1) is specifically provided in the table so there shouldn't be any room for misunderstanding.
I agree an extra 'the' would probably be marginally better English, but again you would be hard pressed to say the current version is incorrect or able to be misunderstood given the numerous examples.
- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 124
the added.
The definition of rad(1) can be read from the table.
The definition of rad(1) can be read from the table.

War ruins the life and health of untold numbers of innocent children.