From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: common divisor selector
Date: Fri, 6 Mar 2009 20:53:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <gos2fd$ocj$>
References: <>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1236372781 24979 (6 Mar 2009 20:53:01 GMT)
NNTP-Posting-Date: Fri, 6 Mar 2009 20:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:523131

Sam Van der Jeught <> wrote in message <>...
> Hi all,
> is there an easy (= low calculation intensity) way to check how many common divisors the integers in a given array have? 
> e.g. :(2,3,5,7,10,15) ==> (2,5 and 10| 3,5 and 15 )= 6 times
> Thanks!
> Sam

  Your description is not at all clear, Sam.  Taking your question literally there would be no common divisors at all in your example array except the number 1.  Suppose the array consists of just the two elements [60,90].  As a pair they possess six different common divisors excluding 1.  What would your count be and how is it compatible with having counted the 5 in your example twice?  You need to explain things much more carefully so that others can understand what it is you are asking.  We aren't mind readers.

Roger Stafford