GCD ... period!

For m > 1 m>1 , it can be proven that the integer sequence f m ( n ) = gcd ( n + m , m n + 1 ) f_m(n) = \gcd(n+m,mn+1) has a fundamental period T m . T_m. In other words, n N , f m ( n + T m ) = f m ( n ) . \forall n \in \mathbb{N}, \space f_m(n+T_m) = f_m(n). Find an expression for T m T_m in terms of m , m, and then give your answer as T 12 . T_{12}.


The answer is 143.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

6 solutions

Mark Hennings
May 17, 2018

Relevant wiki: Greatest Common Divisor - Problem Solving

Suppose that m , n N m,n \in \mathbb{N} are such that m > 1 m > 1 . If d d divides both n + m n+m and m n + 1 mn+1 , then d d divides m ( n + m ) ( m n + 1 ) = m 2 1 m(n+m)-(mn+1) = m^2-1 , and hence d d divides both n + ( m 2 1 ) + m n+(m^2-1)+m and m ( n + m 2 1 ) + 1 m(n+m^2-1)+1 . In other words, d d divides f m ( n + m 2 1 ) f_m(n+m^2-1) . Thus we deduce that f m ( n ) f_m(n) divides f m ( n + m 2 1 ) f_m(n+m^2-1) . On the other hand, if d d divides both n + ( m 2 1 ) + m n+(m^2-1)+m and m ( n + m 2 1 ) + 1 m(n+m^2-1)+1 , then it also divides m ( n + ( m 2 1 ) + m ) ( m ( n + m 2 1 ) + 1 ) = m 2 1 m\big(n+(m^2-1)+m\big) - \big(m(n+m^2-1)+1\big) = m^2-1 , and hence it divides both n + m n+m and m n + 1 mn+1 as well, so that it divides f m ( n ) f_m(n) . Thus we deduce that f m ( n + m 2 1 ) f_m(n+m^2-1) divides f m ( n ) f_m(n) . In other words, we have shown that f m ( n + m 2 1 ) = f m ( n ) f_m(n + m^2-1) = f_m(n) . This means that T m T_m divides m 2 1 m^2-1 for all integers m > 1 m > 1 .

Note that f m ( m 2 m 1 ) f_m(m^2-m-1) is the highest common factor of m 2 1 m^2-1 and m ( m 2 m 1 ) + 1 = m 3 m 3 m + 1 = ( m 1 ) ( m 2 1 ) m(m^2-m-1) + 1 = m^3-m^3-m+1 = (m-1)(m^2-1) , and so f m ( m 2 m 1 ) = m 2 1 f_m(m^2-m-1) = m^2-1 . This means that f m ( m 2 m 1 + T m ) = m 2 1 f_m(m^2-m-1+T_m) = m^2-1 . This implies that m 2 1 m^2-1 divides m 2 1 + T m m^2-1+T_m , and hence that m 2 1 m^2-1 divides T m T_m . Thus we have shown that T m = m 2 1 T_m = m^2-1 for all integers m > 1 m > 1 . T 12 = 143 T_{12} = \boxed{143} .


An earlier version of the question asked for m = 2 1 T m = m = 2 1 ( m 1 ) ( m + 1 ) = 1 2 m = 2 ( 1 m 1 1 m + 1 ) = 3 4 \sum_{m=2}^\infty \frac{1}{T_m} \; = \; \sum_{m=2}^\infty \frac{1}{(m-1)(m+1)} \; = \; \frac12\sum_{m=2}^\infty \left(\frac{1}{m-1} - \frac{1}{m+1}\right) \; = \; \frac34 making the answer 3 + 4 = 7 3+4=\boxed{7} .

Has the way of entering the response changed? I think this earlier one was better since now you can get the problem out simply by evaluating T12 with a little code or plotting a graph of f12 (n). Also before, it deals with more topics of mathematics such as the evaluation of summations from decomposition in simple fractions. By the way there is a small typographical error towards the end, in the first summation, where you put Tn instead of Tm.

Pau Cantos - 3 years ago

I don't get the earlier version so can you please send me a link to that one?

Ariijit Dey - 3 years ago

Log in to reply

Someone edited it into the current form. The old version no longer exists.

Mark Hennings - 3 years ago

Log in to reply

Ya Ok! Also can you please tell me how to use Mathematica?

Ariijit Dey - 3 years ago
Arjen Vreugdenhil
May 29, 2018

Relevant wiki: Greatest Common Divisor - Problem Solving

Key fact : gcd ( a , b ) = gcd ( a , b + k a ) \gcd(a,b) = \gcd(a,b + ka) for any integer k k . This will be used several times in the reasoning below.

First, note that gcd ( m + n , m n + 1 ) = gcd ( m + n , m ( m + n ) ( m 2 1 ) ) = gcd ( m + n , m 2 1 ) \gcd(m+n,mn+1) = \gcd\left(m+n\ ,\ m(m+n) - (m^2-1)\right) = \gcd(m+n,m^2-1) and likewise gcd ( m + n + T , m ( n + T ) + 1 ) = gcd ( m + n + T , m ( m + n + T ) ( m 2 1 ) ) = gcd ( m + n + T , m 2 1 ) . \gcd(m+n+T,m(n+T)+1) = \gcd\left(m+n+T\ ,\ m(m+n+T) - (m^2-1)\right) = \gcd(m+n+T,m^2-1). We want to find a positive value for T T for which these two expressions are equal independent of the value of n n . Obviously, T = m 2 1 T = m^2-1 works because gcd ( m + n + ( m 2 1 ) , m 2 1 ) = gcd ( m + n , m 2 1 ) . \gcd(m+n+(m^2-1),m^2-1) = \gcd(m+n,m^2-1). But T = m 2 1 T = m^2-1 is also the smallest positive value that works. To see that, suppose T < m 2 1 T < m^2-1 . Choose n = ( m 2 1 ) m n = (m^2-1)-m . Then gcd ( m + n , m 2 1 ) = gcd ( m 2 1 , m 2 1 ) = m 2 1 but gcd ( m + n + T , m 2 1 ) = gcd ( m 2 1 + T , m 2 1 ) = gcd ( T , m 2 1 ) T < m 2 1 , \gcd(m+n,m^2-1) = \gcd(m^2-1,m^2-1) = m^2-1\ \ \ \ \text{but}\ \ \ \ \ \gcd(m+n+T,m^2-1) = \gcd(m^2-1+T,m^2-1) = \gcd(T,m^2-1) \leq T < m^2-1, which is a contradiction.

We conclude T m = m 2 1 \boxed{T_m = m^2-1} and T 12 = 1 2 2 1 = 143 \boxed{T_{12} = 12^2-1 = 143} .

Hdjdms Shsnd
May 27, 2018

Relevant wiki: Greatest Common Divisor - Problem Solving

g c d ( n + m , m n + 1 ) = g c d ( n + m , m n + 1 m ( n + m ) ) = g c d ( n + m , 1 m 2 ) = g c d ( n + m , m 2 1 ) gcd ( n+m, mn+1 ) = gcd (n+m, mn+1 - m(n+m) ) = gcd ( n+m, 1-m^2) = gcd ( n+m, m^2-1) . Clearly this is periodic in n n with a period of m 2 1 m^2-1 , but we must show that this is the fundamental period. g c d ( n + m , m 2 1 ) = m 2 1 gcd(n+m, m^2-1) = m^2-1 when m 2 1 n + m m^2-1 | n+m , meaning that this value cannot occur more frequently than every m 2 1 m^2-1 values of n n , proving that the period is fundamental. Lastly, 1 2 2 1 = 143 12^2-1 = 143

Ritwik Roy
May 28, 2018

This is a rusty C program,but it works.Here in main()," i" acts as period T and assuming T<100000 we get the answer 143

include<stdio.h>

int gcd(int a,int b)
{
    if(a>b)
    {
        a=a-b;
        gcd(a,b);
    }
    else if(a<b)
    {
        b=b-a;
        gcd(a,b);
    }
    else if(a==b)
    {
        return a;
    }
}
int fn(int i)
{
    int f=gcd(12+i,12*i+1);
    return f;
}
void main()
{
    int i,j,flag=0;
    for(i=1;i<100000;i++)
    {
        for(j=1;j<100;j++)
        {
             if( fn(i+j)==fn(j))
             {
                 flag=1;
             }
             else
             {
                 flag=0;
                 break;
             }
        }
    if(flag==1)
        {
            printf("%d",i);
            break;
        }
        flag=0;
    }
}

Your gcd function has a problem: if a < b a<b or a > b a>b , no return value is specified. You should write return gcd(a,b); instead of just gcd(a,b);

Arjen Vreugdenhil - 3 years ago

Log in to reply

Good point. I adapted it into awk and was puzzled by its lack of any meaningful answer.

Bert Seegmiller - 2 years, 12 months ago
Ariijit Dey
Jun 3, 2018

f m ( n ) = g c d ( m + n , m n + 1 ) f_m(n) = gcd(m+n,mn+1) f m ( n ) = g c d ( ( m 1 ) ( n 1 ) , m n + 1 ( 1 ) \Rightarrow f_m(n) = gcd((m-1)(n-1),mn+1 -------------(1) for a period T m T_m we have , f m ( n + T m ) = g c d ( ( m 1 ) ( n + T m 1 ) , m n + m T m + 1 ) = d ( s a y ) ( 2 ) \Rightarrow f_m(n+T_m) = gcd((m-1)(n+T_m-1),mn+mT_m+1) = d (say) ----------------------------(2) so, d ( m + n ) ( ) d|(m+n)-------(*) and d m n + 1 ( ) d|mn+1--------(*) implies m n ( m o d d ) \Rightarrow m\equiv-n (\mod d) and m n 1 ( m o d d ) mn\equiv -1 (\mod d) or, m 2 = 1 ( m o d d ) m^2 = 1 (\mod d) which need not always have a trivial solution. but from (2) we get d [ ( m 1 ) ( n 1 ) + ( 1 m ) T m ] d | [(m-1)(n-1)+(1-m)T_m] and d m n + 1 + ( m T m ) d | mn+1+(mT_m) which along with (1) results in d ( 1 m ) T m d | (1-m)T_m and d m T m d | mT_m ; Now it is sufficient to look that d T m d | T_m solves our problem; Since T m T_m is the fundamental period so T m = d ( 3 ) T_m=d ----------(3) . Now from ( * ) we also know that d m 2 1 d | m^2-1 and so T m ( m 2 1 ) T_m | (m^2-1) and thus T m = m 2 1 T_m=m^2-1 is the fundamental period

Albert Yiyi
May 29, 2018

By Euclid's algorithm, gcd ( a , b ) = gcd ( a , k a + b ) where k is any integer \gcd(a,b) = \gcd(a,ka+b)\text{ where }k\text{ is any integer}

take a = ( n + m ) , b = ( m n + 1 ) , k = m , \text{take }a=(n+m), b=(mn+1), k=-m,

gcd ( n + m , m n + 1 ) = gcd ( n + m , 1 m 2 ) = gcd ( n + m , m 2 1 ) \gcd(n+m,mn+1)=\gcd(n+m,1-m^2)=\gcd(n+m,m^2-1)

since period T m T_m is invariant under shifting n n to n n 0 n-n_0 ,

we consider period of g m ( n ) = f m ( n m ) = gcd ( n , m 2 1 ) g_m(n)=f_m(n-m)=\gcd(n,m^2-1)

which is obvious that T m = m 2 1 T_m=m^2-1 since m 2 1 m^2-1 is a constant.

hence T m = 1 2 2 1 = 143 T_m=12^2-1=143

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...