From Pat Winstanley · 1996-04-08 19:10 · #69268 in DRIVING
In reply to Re: BIO '96 by Paul Walker
Hi Paul,
Monday April 08 1996 21:44, Paul Walker wrote to Pat Winstanley:
PWa> Hey Pat, I think you need to check your clock.... :))
No need... I know exactly why it does what it does, and I can't be bothered adjusting it for the leap year and the recent hour change... :-)
PWa> Maybe you can explain. Which divisors? There are... lots,
PWa> for each number. Does it have to be the lowest ones (!= 1),
PWa> or something?
Was that aimed at me or Chris?
Anyway, my reading of it was to find all the numbers that another number could be divided by (whole numbers all round), then add the numbers you find together. Any 'root' number with a total the same as another 'root' number would be amicable...
You could do it with a simple loop (iterated through an overall loop)
for NUMBER = 1 to 100
for PROPOSED_DIVISOR = 1 to NUMBER
if NUMBER mod PROPOSED_DIVISOR = 0 then
/* The PROPOSED_DIVISOR is a real divisor for NUMBER */
/* store NUMBER in an array with the running TOTAL
of its true DIVISOR values
next
next
/* Now go through the array of NUMBER/TOTALS
see which NUMBERs, if any, have identical TOTALs */
Well that's one way... though could probably be made much more elegant.
[dominoes]
PWa> :)) Sideways? Up and across, too...
Yes, well that's what I *meant*! :-)
Pat
---
* Origin: Pierless, Wigan, UK. [01942-749012 (cable)] (2:250/107.99)