Sum of all

Find the value of x = 1 2015 gcd ( x , 2015 ) , \sum _{x=1}^{2015}\text{gcd} \left(x,2015\right), where gcd ( a , b ) \text{gcd}(a,b) is the greatest common divisor function.


The answer is 13725.

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.

7 solutions

Otto Bretscher
May 30, 2015

We can summarize Mayank's approach in the formula n d n ϕ ( d ) d = 2015 ( 1 + 4 5 + 12 13 + 30 31 + 48 65 + 120 155 + 360 403 + 1440 2015 ) n\sum_{d|n}\frac{\phi(d)}{d}=2015\left(1+\frac{4}{5}+\frac{12}{13}+\frac{30}{31}+\frac{48}{65}+\frac{120}{155}+\frac{360}{403}+\frac{1440}{2015}\right) = 13725 =\boxed{13725}

Nice. ; ) short n sweet summary sir Otto Bretscher

Mayank Chaturvedi - 6 years ago

Why doesn't the formula n × ϕ ( n ) 2 \large\frac{n\times\phi(n)}{2} work? Because using this formula I get 2015 × 1440 2 = 1450800 \frac{2015\times1440}{2}=1450800

Eamon Gupta - 6 years ago

Log in to reply

Why should it work?

Calvin Lin Staff - 5 years, 7 months ago

Log in to reply

Sorry, my mistake. I read about the formula about a similar type of question.

Eamon Gupta - 5 years, 7 months ago

@Otto Bretscher how do we get this formula here ; can i get relevant wiki about the solution ?

Syed Hissaan - 4 years ago

how is the formula related with this problem???

trupti chaudhari - 5 years, 8 months ago
Mayank Chaturvedi
May 30, 2015

I have solved this question with the help of Euler's function. Short methods and advises are always welcome. F i r s t o f a l l , n o t e t h a t 2015 = 13 31 5. A l l p o s s i b l e f a c t o r s o f 2015 a r e 1 , 5 , 13 , 31 , 65 , 155 , 403 a n d 2015. T h e r e f o r e a l l p o s s i b l e G C D s a r e 1 , 5 , 13 , 31 , 65 , 155 , 403 a n d 2015. T h e p r o c e s s i s e x p l a i n e d b y t h e f o l l o w i n g t w o f a c t o r s o f 2015 a n d t h e n i t i s a p p l i e d t o r e s t f a c t o r s : G C D = 1 ϕ ( 2015 ) = 1440 G C D = 5 W e h a v e t o f i n d o u t a l l 5 x s u c h t h a t x i s r e l a t i v e l y p r i m e t o 2015 s i n c e 5 403 = 2015 , ϕ ( 403 ) i s t h e n u m b e r o f a l l t h e n u m b e r s x s u c h t h a t : ( x , 2015 ) = 5. S o , s u m o f a l l G C D 5 s i s ϕ ( 403 ) 5 N o t e t h a t ϕ ( 1 ) + ϕ ( 5 ) + ϕ ( 13 ) + ϕ ( 31 ) + ϕ ( 65 ) + ϕ ( 155 ) + ϕ ( 403 ) + ϕ ( 2015 ) = 2015 A s t h e p r o c e s s c o u l d b e u n d e r s t o o d , x = 1 2015 ( x , 2015 ) = 2015 ϕ ( 1 ) + 403 ϕ ( 5 ) + 155 ϕ ( 13 ) + 65 ϕ ( 31 ) + 31 ϕ ( 65 ) + 13 ϕ ( 155 ) + 5 ϕ ( 403 ) + ϕ ( 2015 ) x = 1 2015 ( x , 2015 ) = 13725 First\quad of\quad all,\quad note\quad that\quad 2015=13*31*5.\\ All\quad possible\quad factors\quad of\quad 2015\quad are\quad 1,5,13,31,65,155,403\quad and\quad 2015.\\ Therefore\quad all\quad possible\quad GCDs\quad are\quad 1,5,13,31,65,155,403\quad and\quad 2015.\\ The\quad process\quad is\quad explained\quad by\quad the\quad following\quad two\quad factors\quad of\quad 2015\\ and\quad then\quad it\quad is\quad applied\quad to\quad rest\quad factors:\\ \rightarrow \quad GCD\quad =\quad 1\\ \phi (2015)=1440\\ \rightarrow \quad GCD\quad =\quad 5\\ We\quad have\quad to\quad find\quad out\quad all\quad 5*x\quad such\quad that\quad x\quad is\quad relatively\quad \\ prime\quad to\quad 2015\\ since\quad 5*403=2015,\quad \phi (403)\quad is\quad the\quad number\quad of\quad all\quad the\quad \\ numbers\quad x\quad \\ such\quad that:\\ (x,2015)=5.\quad So,\quad sum\quad of\quad all\quad GCD\quad 5s\quad is\quad \phi (403)*5\\ \\ Note\quad that\quad \phi (1)+\phi (5)+\phi (13)+\phi (31)+\phi (65)+\phi (155)\\ +\phi (403)+\phi (2015)=\quad 2015\\ \\ As\quad the\quad process\quad could\quad be\quad understood,\\ \sum _{ x=1 }^{ 2015 }{ (x,2015) } =2015*\phi (1)+403*\phi (5)+155*\phi (13)+\\ 65*\phi (31)+31*\phi (65)+13*\phi (155)+5*\phi (403)+\phi (2015)\\ \\ \sum _{ x=1 }^{ 2015 }{ (x,2015) } =13725 Suggestions are always WELCOME

Yeah , same method. :)

Nihar Mahajan - 6 years ago

Log in to reply

Hello friend, Are you a student of class 9th Nihar Mahajan ?

Mayank Chaturvedi - 6 years ago

Log in to reply

No am in Std. 10

Nihar Mahajan - 6 years ago

Not a proof but just an observation of the general form.

Let f ( n ) = x = 1 n gcd ( x , n ) f(n) = \sum _{x=1}^{n}\text{gcd} \left(x,n\right)

And g ( a , b ) = a b 1 ( b ( a 1 ) + a ) g(a,b) = a^{b-1}(b(a-1) + a)

Then, if n = p 1 a 1 p 2 a 2 . . . n = p_1^{a_1}p_2^{a_2}... ,

f ( n ) = g ( p 1 , a 1 ) g ( p 2 , a 2 ) . . . f(n) = g(p_1,a_1)*g(p_2,a_2)*...

In this problem, 2015 = 5 13 31 2015 = 5*13*31 .

And f ( n ) = g ( 5 , 1 ) g ( 13 , 1 ) g ( 31 , 1 ) = 9 25 61 = 13725 f(n) = g(5,1) * g(13,1) * g(31,1) = 9 * 25 * 61 = \boxed{13725}

Yes. This is because the convolution of two multiplicative functions is multiplicative, so f ( x ) f ( y ) = f ( x y ) f(x)f(y) = f(xy) for relatively prime x x and y y . Your g ( p 1 , a 1 ) g(p_1,a_1) is just f ( p 1 a 1 ) f(p_1^{a_1}) .

Patrick Corn - 6 years ago

My Java code :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
int x,s=0;
for(x=1;x<=2015;x++)
{
    int m=gcd(x,2015);
    s=s+m;
}
        System.out.println(""+s); 

/** The method called upon :

    public int gcd(int a,int b){

int c,gcd;

while(b!=0)
{
    c=b;
    b=a%c;
    a=c;

}
     return a;
    }

a=13725

As soon as I read this question , I felt the urge to CS Bash this question .

Hope you don't mind @Julian Poon ;)

Log in to reply

I encourage any form of solution.... partly because I don't know any form of coding :D

Julian Poon - 6 years ago

Log in to reply

Really ? Anyway , since LaTeX \LaTeX is a document formatting language , you do know coding :P

Log in to reply

@A Former Brilliant Member ok...

I can't do coding that has the ability to.......do something other than formatting

Julian Poon - 6 years ago

We want Sum over d|2015 of d phi ( 2015/d) = (5+(5-1))x(13+(13-1))x(31+(31-1)) which can be shown using product expansion and the definition of phi. This product is 9x25x61=13725

Luis Novoa
May 2, 2017

For pairwise coprime a, b, and c, x = 1 a b c g c d ( x , a b c ) = 8 a b c 4 ( a b + a c + b c ) + 2 ( a + b + c ) 1 \sum_{x=1}^{abc}gcd(x,abc)=8abc-4(ab+ac+bc)+2(a+b+c)-1 Plugging in a = 5 , b = 13 , c = 31 , a=5, b=13, c=31, we get 13725 \boxed{13725}

How do you get this formula??

Jit Sadhu - 11 months, 2 weeks ago
Noname Name
Feb 13, 2021

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...