Sum of all greatest values

Compute

gcd ( 1 , 155 ) + gcd ( 2 , 155 ) + gcd ( 3 , 155 ) + + gcd ( 155 , 155 ) . \gcd(1,155) + \gcd(2,155) + \gcd(3,155) + \cdots + \gcd(155,155) .

Notation : gcd ( m , n ) \gcd(m,n) denote the Greatest Common Divisor of integers m m and n n .


The answer is 549.

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.

3 solutions

A A
Dec 2, 2015

155 = 5*31

gcd(x,155)=1 unless x is a multiple of 5 and/or 31.

There are 4 x-values that are only multiples of 31, and 30 x-values that are only multiples of 5. 155 is a multiple of both. There are (155-35)=120 x-values remaining; for these, the GCD will be 1.

4(31) + 30(5) + 1(155) + 120(1) = 549.

Did the same.

Shreyash Rai - 5 years, 6 months ago

Did same...

Dev Sharma - 5 years, 6 months ago
Otto Bretscher
Dec 2, 2015

The function f ( n ) = k = 1 n gcd ( k , n ) f(n)=\sum_{k=1}^{n}\gcd(k,n) is multiplicative, so f ( 155 ) = f ( 5 ) f ( 31 ) = ( 4 + 5 ) ( 30 + 31 ) = 549 f(155)=f(5)f(31)=(4+5)(30+31)=\boxed{549}

Do you know the demonstration of that?

Mateo Matijasevick - 5 years, 6 months ago

Log in to reply

The gcd sum is the Dirichlet convolution of the identity with Euler's totient function.

Otto Bretscher - 5 years, 6 months ago

Log in to reply

I think you should still add one line of explanation for why

i = 1 n gcd ( i , n ) = d n d × ϕ ( n d ) \sum_{i=1}^n \gcd(i, n) = \sum_{d \mid n } d \times \phi(\frac{n}{d} )

Calvin Lin Staff - 5 years, 6 months ago

Log in to reply

@Calvin Lin For a given divisor d d of n n , we need to count the i i with 1 i n 1\leq i\leq n such that gcd ( i , n ) = d \gcd(i,n)=d . By definition of gcd, those are of the form i = k d i=kd where 1 k n / d 1\leq k \leq n/d and gcd ( k , n / d ) = 1 \gcd(k,n/d)=1 . There are ϕ ( n / d ) \phi(n/d) such k k 's; thus the term d × ϕ ( n / d ) d\times \phi(n/d) in our sum.

Otto Bretscher - 5 years, 6 months ago

Factors of 155 are 1,5,31,155. Now there are 30 numbers within 1 to155 which are divisible by 5. Now they have gcd 5 with 155. Similarly there are 4 numbers divisible by 31 and having gcd 31 with155 within the limit. Rest numbers 120 are coprime with 155. 155 has155 as gcd with 155. So summing we get 549.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...