Sorry - I didn't express myself very clearly. Yes, we're looking for 
common factors of A and B. One way to get there is by my initial 
approach: find the prime factors of each, select those that are in 
common, and then take pairwise products. My initial question was about 
the last step only. But your approach to the whole problem sidesteps 
that. It's more elegant, as well as faster, than the way I thought of 
the problem.

Gordon

Stavros Macrakis wrote:
> On Wed, Feb 25, 2009 at 9:25 AM, Fox, Gordon <gfox@cas.usf.edu> wrote:
>   
>> The tricky part isn't finding the common factors -- we knew how to do
>> that, though not in so concise a fashion as some of these suggestions.
>> It was finding all their products without what I (as a recovered Fortran
>> programmer) would call "truly brute force." Several of these suggestions
>> solve the problem nicely!
>>     
>
> Are you sure you are not confusing *prime factors* with *factors*?  My
> understanding is that you are looking for all the factors of A which
> are also factors of B, i.e. the common factors of A and B.  Why else
> would you be computing all those products?
>
>                -s
>   

-- 
Dr. Gordon A. Fox       Voice: (813)974-7352       Fax: (813)974-3263
Dept. of Integrative Biology ((for US mail:)SCA 110) ((for FedEx etc:)NES 107)
Univ. of South Florida                 4202 E. Fowler Ave.
Tampa, FL 33620, USA                   http://foxlab.cas.usf.edu

"Trying is the first step towards failure." -- Homer Simpson



	[[alternative HTML version deleted]]


