Proving that gcd(x, n) = gcd(n-x, n) for 0 ≤ x ≤ n/2

  • Thread starter gimpy
  • Start date
In summary: Then work out phi(pr) for a prime power, and then deduce, trivially, the general case (since phi is multiplicative).In summary, we are working with the integers and the proof for gcd(x,n) = gcd(n-x,n) for all 0 \leq x \leq n/2 can be easily shown by considering the set of divisors for n and x, and the set of divisors for n-x and n, which must be the same. As for proving that the Euler totient function is an even number, it can be shown by first proving that phi(ab) = phi(a)phi(b) if a and b are coprime
  • #1
gimpy
28
0
Ok I am trying to solve this question.

Assume [tex]n \geq 3[/tex], prove that [tex]gcd(x, n) = gcd(n-x, n)[/tex] for all [tex]0 \leq x \leq n/2[/tex].

This is what i got:

[tex]x = 0[/tex] then [tex]gcd(0, n) = gcd(n-0, n) = n[/tex]

[tex]x = n/2[/tex] then [tex]gcd(n/2, n) = gcd(n-n/2, n) = n/2[/tex]

[tex]0 < x < n/2[/tex] then [tex]x = n/k[/tex] for some [tex]k>2[/tex]

[tex]gcd(n/k, kn/k) = n/k[/tex] because [tex]n = kn/k[/tex]

so [tex]n - n/k = kn/k - n/k = (kn - n)/k = (k-1)n/k[/tex]

therefore [tex]gcd(n-x, n) = gcd((k-1)n/k, kn/k) = n/k[/tex]

therefore [tex]gcd(x, n) = gcd(n-x, n)[/tex]

Im not sure if that is correct but it makes sense to me. Anyways after this qeustion i have to answer this one:

Use the previous question to prove that [tex]\phi(n)[/tex] is an even number. Where [tex]\phi(n)[/tex] is the eurler function.

Im having trouble with this one. Can anyone help me out?
 
Physics news on Phys.org
  • #2
Originally posted by gimpy
[tex]0 < x < n/2[/tex] then [tex]x = n/k[/tex] for some [tex]k>2[/tex]

This is not true, not if x, n and k are integers. For example, if n is prime then clearly this only works for x = 1.

This makes the proof easy, since making this (wrong) assumption is the same as assuming [itex]\gcd(x,n)=x[/itex].
 
Last edited:
  • #3
you're just working in the integers; always avoid writing fractions, so you don't make impossible calculations.


here, it is a trivial exercise with the following definition of gcd:

let I(a,b) be the ideal in Z of all numbers of the form ax+by, for x,y integers.

the gcd is the minimal positive element of this ideal. here it is trivial because clearly I(a,b) and I(a-b,b) are the same set.

if you've another definition for gcd use it, perhaps by linking this to your defintion.
 
  • #4
Yeah ok, i guess i am just working with integers, if i wasn't then gcd wouldn't make sense right? But why does it say that [tex]0 \leq x \leq n/2[/tex], can't x be any real number? And when you subtract [tex]n-x[/tex] wouldn't this be any real number and not an integer depending on what value x is? Or is it that i am only supposed to choose an x such that [tex]n-x[/tex] is an integer?

Assume [tex]n \geq 3[/tex], prove that [tex]gcd(x, n) = gcd(n-x, n)[/tex] for all [tex]0 \leq x \leq n/2[/tex].

Originally posted by matt grime
you're just working in the integers; always avoid writing fractions, so you don't make impossible calculations.


here, it is a trivial exercise with the following definition of gcd:

let I(a,b) be the ideal in Z of all numbers of the form ax+by, for x,y integers.

the gcd is the minimal positive element of this ideal. here it is trivial because clearly I(a,b) and I(a-b,b) are the same set.

if you've another definition for gcd use it, perhaps by linking this to your defintion.
 
  • #5
An inequality such as [itex]0\leq x\leq n/2[/itex] doesn't always mean x is a real number. You have to consider the context. And in this case the numbers you're working with (x and n) must be integers, since the idea of divisiblity doesn't have any meaning when talking about real numbers.
 
  • #6
Originally posted by gimpy
Yeah ok, i guess i am just working with integers, if i wasn't then gcd wouldn't make sense right? But why does it say that [tex]0 \leq x \leq n/2[/tex], can't x be any real number? And when you subtract [tex]n-x[/tex] wouldn't this be any real number and not an integer depending on what value x is? Or is it that i am only supposed to choose an x such that [tex]n-x[/tex] is an integer?

Assume [tex]n \geq 3[/tex], prove that [tex]gcd(x, n) = gcd(n-x, n)[/tex] for all [tex]0 \leq x \leq n/2[/tex].


You are working in the ring of integers. Why should you be able to pass to the ring of Real numbers?
I don't know why that inequality is placed in the question.

Here's a simple direct proof as you didn't say the indirect one was useful.


suppose r divides n and n-x, then r divides n-(n-x)=x. ie it divides n and x.


suppose now that r divides n and x, well, then it trivially divides n-x.

So the set of divisors of n and x, and the set of divisors of n-x and n are the same. And the maximal element in the set must be the same to (they are finite sets). Absolutely no need to invoke any inequality. I'd ask why your teacher out it there, or let us know which book this is taken from.


As the the Euler totient function. first show that

phi(ab)=phi(a)phi(b) if a and b are coprime, then deduce it suffices to workout phi(q) for q some power of a prime p. This is easy to do by hand by counting multiples of p less than q
 

What is the purpose of proving that gcd(x, n) = gcd(n-x, n) for 0 ≤ x ≤ n/2?

The purpose of this proof is to show that the greatest common divisor (gcd) of two numbers remains the same regardless of whether the numbers are swapped or subtracted from a larger number. This property is useful in many areas of mathematics, such as number theory and cryptography.

What is the significance of the range 0 ≤ x ≤ n/2 in this proof?

The range 0 ≤ x ≤ n/2 is significant because it covers all possible values of x that are less than or equal to half of n. By proving the property for this range, we can generalize it for all values of x and n.

How can this proof be applied in real-world situations?

This property can be applied in real-world situations, such as in computer science and engineering, where finding the gcd of two numbers is important in optimizing algorithms and solving problems related to modular arithmetic.

What are the steps involved in proving this property?

To prove that gcd(x, n) = gcd(n-x, n) for 0 ≤ x ≤ n/2, we can use the Euclidean algorithm to find the gcd of both sides and show that they are equal. This involves repeatedly dividing the larger number by the smaller number until a remainder of 0 is reached, and the last non-zero remainder is the gcd.

Are there any exceptions to this property?

No, there are no exceptions to this property. It holds true for all values of x and n, as long as x is in the range 0 ≤ x ≤ n/2. This can be proven algebraically and is a fundamental property of the gcd function.

Similar threads

  • Linear and Abstract Algebra
Replies
8
Views
898
  • Linear and Abstract Algebra
Replies
2
Views
1K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Precalculus Mathematics Homework Help
Replies
14
Views
963
  • Programming and Computer Science
Replies
2
Views
867
  • Precalculus Mathematics Homework Help
Replies
2
Views
901
  • Linear and Abstract Algebra
Replies
3
Views
1K
  • Linear and Abstract Algebra
Replies
10
Views
1K
  • Linear and Abstract Algebra
Replies
20
Views
3K
Back
Top