Top "Greatest-common-divisor" questions

The greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.

Python gcd for list

I want to calculate gcd for a list of numbers. But I don't know what's wrong with my code. A = [12, 24, 27, 30, 36] …

python algorithm greatest-common-divisor
RSA: Private key calculation with Extended Euclidean Algorithm

I'm a high school student writing a paper on RSA, and I'm doing an example with some very small prime …

algorithm rsa private-key greatest-common-divisor
program for finding Gcd in Prolog

I tried to write a code in Prolog for finding GCD (without using modulo) can anyone tell me what's wrong …

prolog greatest-common-divisor
Euclidean greatest common divisor for more than two numbers

Can someone give an example for finding greatest common divisor algorithm for more than two numbers? I believe programming language …

algorithm math greatest-common-divisor
Numpy gcd function

Does numpy have a gcd function somewhere in its structure of modules? I'm aware of fractions.gcd but thought a …

python numpy greatest-common-divisor
GCD and LCM relation

The following relation works only for two (3, 12) numbers, it fails to produce the right answer when used for three numbers (3,12,10) . …

greatest-common-divisor lcm
Running Time of GCD Function Recursively (Euclid Algorithm)

I have only been able to find posts about how to implement the gcd function both recursively and iteratively, however …

c runtime time-complexity recurrence greatest-common-divisor
Using recursion and implementing Euclid's algorithm to find GCD of three numbers from user

I am wanting to ask the user to input three numbers and then have program calculate the GCD using Euclid's …

java algorithm recursion greatest-common-divisor
Get the gcd of n numbers

This could seem an easy question but I cannot find a solution. I must find the gcd of n numbers. …

java math greatest-common-divisor
What is the fastest way to check if two given numbers are coprime?

One way is to calculate their gcd and check if it is 1. Is there some faster way?

algorithm number-theory greatest-common-divisor