Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

Friendly numbers

Last post 07-08-2008, 1:24 PM by mt2. 10 replies.
Sort Posts: Previous Next
 06-30-2008, 9:56 PM 30257957  

Friendly numbers

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
 
 06-30-2008, 11:09 PM 30257962 in reply to 30257957  

Re: Friendly numbers

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  :-)

 
 07-02-2008, 7:24 AM 30258103 in reply to 30257962  

Re: Friendly numbers

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.
 
 07-02-2008, 7:26 AM 30258104 in reply to 30257962  

Re: Friendly numbers

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.
 
 07-03-2008, 1:32 PM 30258241 in reply to 30258103  

Re: Friendly numbers

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
 
 07-03-2008, 10:02 PM 30258268 in reply to 30258241  

Re: Friendly numbers

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

?

 
 07-04-2008, 8:53 AM 30258299 in reply to 30258268  

Re: Friendly numbers

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
 
 07-04-2008, 11:58 AM 30258306 in reply to 30258299  

Re: Friendly numbers

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 "

 
 07-08-2008, 12:42 PM 30258563 in reply to 30258299  

Re: Friendly numbers

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?

 
 07-08-2008, 1:20 PM 30258569 in reply to 30258563  

Re: Friendly numbers

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
 
 07-08-2008, 1:24 PM 30258570 in reply to 30258569  

Re: Friendly numbers

Ok! Thanks for clarification!
 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...