« first day (932 days earlier)
← previous day
next day →
last day (15 days later) »
Aladdin
5:36 AM
@JohnRennie Hi
John Rennie
Hi :-)
Aladdin
needed help in understanding an algorithm
geeksforgeeks.org/program-to-find-gcd-or-hcf-of-two-numbers
Can u explain how the eucldeian algorithm section works
like why we need to do the substracting
John Rennie
I have a couple of other questions to answer. I'll ping you as soon as I'm free.
Aladdin
sure
John Rennie
6:26 AM
@Aladdin Hi
Suppose we have two numbers A and B and they have a common divisor n
Then we can write:
A = a × n
B = B × n
We'll assume A > B, then we can subtract B from A:
A - B = an - bn = (a - b)n
But (a - b)n also has a divisor of n because it's a number × n
So that means is n is a divisor of A and a divisor of B then it's also a divisor of A - B
Aladdin
6:53 AM
Ahh got it
John Rennie
OK :-)
« first day (932 days earlier)
← previous day
next day →
last day (15 days later) »
all rooms
Transcript for
Apr
14
Apr
16
Apr
23
Room for Aladdin and John Rennie
1
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile