Sujet : Re: Relatively prime integers in NumPy
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.pythonDate : 11. Jul 2024, 20:35:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87wmlrn5dr.fsf@nightsong.com>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
<
avi.e.gross@gmail.com> writes:
python to make some list or other data structure for divisors of each number
involved
Two numbers a and b are coprime if math.gcd(a,b) == 1, I am pretty sure.
That is true by definition(?) when a and b are both > 0. Experiment
indicates it seems to work even when one or both of a and b are
negative, but I don't have a proof and haven't examined the
implementation. I don't know how gcd is mathematically defined in that
situation.