1

Given a number $n \in \mathbb{N}$, large enough. Can we say something about a sequence $$\{\gcd(n - i, n + i)\}_{i = 1}^k,$$ where $k$ is integer greater than $0$ and less than $n$?

Sorry for too general question, I'm just looking for some theorems involving expressions like the one above, or reference where can I learn about it.

Thanks!

Denisof
  • 229
  • 1
  • 7

1 Answers1

2

The gcd satisfies $\gcd(a,b) = \gcd(a,b+a)$. So your equation is equivalent to $\gcd(2n, n+ i)$. So we are looking for common divisors of $2n$ and $n+i$. This is 1 except if any factor of $i$ divides $n$ or if $2$ divides $n+i$.

Let $d = gcd(n,i)$. Then $n = dm$ and $i = dj$ for some $i,j \in \Bbb Z$. We rewrite as follows $$ \gcd(2n, n+i) = \gcd(2dm, dm + dj) = d \cdot \gcd(2m, m + j) $$ The advantage here is that now $m$ and $j$ are coprime. This implies that any common divisor of $2m$ and $m+j$ must come from $2$. So $\gcd(2m, m+j) = 1$ if $m + j$ odd, and $2$ if $m + j$ even.

Ruben
  • 2,082
  • 1
    Thank a lot! I found your answer veryhelpful! – Denisof Jun 26 '19 at 12:01
  • 2
    @RubenduBurck There're several mistakes. "This is 1 except if $i$ divides $n$ or if $2$ divides $n+i$". By default, English treats "or" as being exclusive & your answer does as well, but it should be inclusive, e.g., use "and/or". Next, "If $i$ divides $n$ the gcd is $i$". Let $n=ki$, so $\gcd(2ki,(k+1)i)$. If $k$ is odd, the gcd is actually $2i$. With "If $2$ divides $i$ then the gcd is the highest power of $2$ dividing both $i$ and $n$", let $i=2^cd$, $n=2^ce$, where $d,e$ are odd, you have $\gcd(2^{c+1}d,2^c(d+e))$, i.e., the power of $2$ in the gcd (not just gcd) is $1$ more. ... – John Omielan Jun 26 '19 at 20:44
  • @RubenduBurck (cont.) Finally, with your final sentence of "So what we get seems to be all divisors of $n$", you should append something like " and $2$ times a divisor of $n$". – John Omielan Jun 26 '19 at 20:46
  • @Denisof The answer is mostly correct, but note there's a few mistakes which I point out in my $2$ comments above. – John Omielan Jun 26 '19 at 20:48
  • @JohnOmielan Thank you for your comment. You are right that I made some mistakes. I will correct them. – Ruben Jun 27 '19 at 08:28
  • 1
    Sorry for a delay, I already got it, the key idea was to use the fact that $\gcd (n + i, n - i) = \gcd (2n, n - i) = \gcd (2n, n + i)$. So anyway thanks! – Denisof Jun 27 '19 at 11:21
  • @RubenduBurck You're welcome. However, it's still not quite correct. A basic one I missed originally is with your statement of "This is 1 except if $i$ divides $n$ or if $2$ divides $n+i$." It's actually if "... 1 except if any factors of $i$ ...". The rest of your answer should be adjusted accordingly to handle possibly only some factors of $i$ dividing $n$ (e.g., use $d = \gcd(n,i)$). Also, with "If $i$ divides $n$ and $i$ is odd, then $\gcd(2n, n+ i) = i$", this is true if $n$ is even, but if $n$ is odd, then the gcd would be $2i$. – John Omielan Jun 27 '19 at 16:50
  • @JohnOmielan Your new comments lead to too many cases, so I redid the whole thing by taking out the gcd of $n$ and $i$ at the start. I think this works now. – Ruben Jun 27 '19 at 17:20
  • @RubenduBurck I agree it's easier & more straightforward to take out the gcd at the beginning, which is why I suggested to use something like $d = \gcd(n,i)$. In my opinion, what you have now is much better. However, there is now just one typo at the end. You write "... and $2$ is $m+j$ odd". It should be "even" instead of repeating "odd". – John Omielan Jun 27 '19 at 17:25