-
mgarlanger
-
-
-
Joined on 10-11-2007
-
-
Posts 165
-
-
|
The problem mentions "friendly pairs", but there can be more than 2 numbers that have the same ratio of 'sum of divisors' to number. For example, Ratio(6) = Ratio(28) = Ratio(496) = 2. If the specified range was between 5 and 500, how should we show that 6, 28, and 496 are a friendly 'family'?
Mark
|
|
| |
-
bugman
-
-
-
Joined on 10-14-2007
-
-
Posts 94
-
-
|
Is the pair (A,B) considered to be the same as (B,A)? If yes, is it necessary to enforce, for example, the constraint A<B?
I assume also that the pairs (A,A) should not be printed :-)
|
|
| |
-
dgeld
-
-
-
Joined on 12-18-2004
-
-
Posts 107
-
-
|
Hello,
even in this case, should we print :
6 and 28 are FRIENDLY
28 and 496 are FRIENDLY
or the complete list of combination (even using A lower then B) :
6 and 28 are FRIENDLY
6 and 496 are FRIENDLY
28 and 496 are FRIENDLY
First version is easier to code :-)
Another FRIENLDY family is :
84 270 1488 1638 which gives 8/3
David.
|
|
| |
-
dgeld
-
-
-
Joined on 12-18-2004
-
-
Posts 107
-
-
|
For the pair(A,A) case, I opened another post but I think that the problem statement is missing A and B should be different.
|
|
| |
|
|
Both of the two formats listed above by David are acceptable.
As for the examples, the first one listing only 2 pairs would be judged deficient. With the three numbers {6, 28, 496}, there are three distinct pairings (as seen in the complete list example).
--clay
"It's all very complicated and would take a scientist to explain it." -- MST3K
|
|
| |
-
bugman
-
-
-
Joined on 10-14-2007
-
-
Posts 94
-
-
|
mad\cpbreshe:
Both of the two formats listed above by David are acceptable.
Clay, could you please clarify what do you mean by the second format? Is this a list like this:
84 270 1488 1638 which gives 8/3
?
|
|
| |
|
|
petert@dcn.nord.nw.ru: mad\cpbreshe:
Both of the two formats listed above by David are acceptable.
Clay, could you please clarify what do you mean by the second format? Is this a list like this:
84 270 1488 1638 which gives 8/3
?
Yes, that is the second format; the first format was a line of output for each distinct pair. The 8/3 is nice, but we would prefer to see that this is a set of friendly pairs ("family" is what someone called this, I think). So, something like the following would be all that is required:
84 270 1488 1638 are FRIENDLY
--clay
"It's all very complicated and would take a scientist to explain it." -- MST3K
|
|
| |
-
bugman
-
-
-
Joined on 10-14-2007
-
-
Posts 94
-
-
|
mad\cpbreshe:
So, something like the following would be all that is required:
84 270 1488 1638 are FRIENDLY
Thanks for clarification. Probably it is necessary to update the problem statement page, since it states "... print each pair of amicable numbers and each pair of friendly numbers "
|
|
| |
-
mt2
-
-
-
Joined on 10-19-2007
-
-
Posts 137
-
-
|
Another question, for only two members family:
1st format:
240 and 600 are FRIENDLY
2nd format:
240 600 are FRIENDLY
Is the 2nd format correct in this case?
|
|
| |
|
|
mt2:
Another question, for only two members family:
1st format:
240 and 600 are FRIENDLY
2nd format:
240 600 are FRIENDLY
Is the 2nd format correct in this case?
Yes. Other acceptable formats would be the following:
240 & 600 are FRIENDLY
600 and 240 are friendly
FRIENDLY: 240 600
Two hundred forty and six hundred are friendly FRIENDLY PAIRS FOUND: 240 600 6 28 28 496 6 496
Output needs to be clear as to what pairs or families of numbers have been found to be FRIENDLY, as well as what pairs have been found to be AMICABLE. The "1st Format" above is very clear, but there are other ways to convey the same information.
--clay
"It's all very complicated and would take a scientist to explain it." -- MST3K
|
|
| |
-
mt2
-
-
-
Joined on 10-19-2007
-
-
Posts 137
-
-
|
Ok! Thanks for clarification!
|
|
| |