1

$n$ is a natural number and after trying the division algorithm

$$\gcd(n^2-3n-1,n-4)=\gcd(n-4,n-1)=\gcd(n-1,-3)=\gcd(n-1,3)$$

For the last part I'm not sure whether it does equal to $\gcd(n-1,3)$. If yes, then should I take the cases where $n$ is $3k+i, 0\le i\le2$?

  • 5
    The answers are "yes" and "yes", but please fix the title of your question. (There is no such thing as "greatest common multiple".) –  Nov 10 '20 at 09:39
  • @StinkingBishop What you fail to reailize is that mathSE reviewers have it all too easy. They should have to work to decipher the question (re OP wants lcm or gcd), before answering it. That is where the real artistry lies. – user2661923 Nov 10 '20 at 09:55
  • @user2661923 I've seen worse cases than this, sadly. –  Nov 10 '20 at 09:56
  • On the off chance that you wanted the lcm, you have the formula for $~a,b ~\in ~\mathbb{Z^+}$ of $$\text{lcm}(a,b) ~=~ \frac{a \times b}{\text{gcd}(a,b)}.$$ – user2661923 Nov 10 '20 at 09:59
  • $\gcd(n-1,3),$ is $,3,$ if $,3\mid n-1,,$ else the gcd $=1\ \ $ – Bill Dubuque Nov 10 '20 at 10:50

3 Answers3

1
  1. If you write as follows $$\gcd(n-4, n-1) = \gcd(n-4, 3) = \gcd(n-1, 3)$$ you will be sure i.e
  • $n-1 - (n-4) = 3$
  • $n-4 + 3 = n-1$
  1. Yes, you can see those cases.
VIVID
  • 11,604
0

After help from the comments and @VIVID.

$$\gcd(n^2-3n-1,n-4)=\gcd(n-4,n-1)=\gcd(n-1,-3)=\gcd(n-1,3)$$

The cases of $n$ are $n=3k,n=3k+1,n=3k+2$ for a natural $k$, will be:

$n=3k \Rightarrow \gcd(3k-1,3)=1$

$n=3k+1 \Rightarrow \gcd(3k,3)=3$

$n=3k+2 \Rightarrow \gcd(3k+1,3)=1$

0

Using this implementation of the Extended Euclidean Algorithm, rotated $90^{\large\circ}$ and applied to polynomials, gives $$ \begin{array}{c|c|c} \color{#00F}{n^2-3n-1}&1&0\\ \color{#00F}{n-4}&0&1\\ \color{#090}{n-1}&\color{#C00}{1}&\color{#C00}{-n}&n\\ \color{#090}{-3}&\color{#C00}{-1}&\color{#C00}{n+1}&1 \end{array} $$ which says that $$ \overbrace{\begin{bmatrix} \color{#C00}{1}&\color{#C00}{-n}\\\color{#C00}{-1}&\color{#C00}{n+1} \end{bmatrix}}^{\det=1} \begin{bmatrix} \color{#00F}{n^2-3n-1}\\\color{#00F}{n-4} \end{bmatrix} =\begin{bmatrix} \color{#090}{n-1}\\\color{#090}{-3} \end{bmatrix} $$ which means any integer linear combination of $n-1$ and $3$ is an integer linear combination of $n^2-3n-1$ and $n-4$ and vice-versa (since the determinant of the matrix is $1$). This means that $$ \gcd\left(n^2-3n-1,n-4\right)=\gcd(n-1,3) $$

robjohn
  • 345,667