Euclidean Algorithm Modified

Find the value of

a = 1 2020 gcd ( a 3 2 a 2 + 2021 , a 2 3 a + 3 ) \sum_{a=1}^{2020} \gcd \left(a^3-2a^2+2021, a^2-3a+3\right)


The answer is 6052.

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.

2 solutions

Chris Lewis
Jan 27, 2021

The Euclidean algorithm makes repeated use of the fact that gcd ( x , y ) = gcd ( x + t y , y ) \gcd(x,y)=\gcd(x+ty,y) , where t t is an integer. We can do the same here: gcd ( a 3 2 a 2 + 2021 , a 2 3 a + 3 ) = gcd ( a 3 2 a 2 + 2021 a × ( a 2 3 a + 3 ) , a 2 3 a + 3 ) = gcd ( a 2 3 a + 2021 , a 2 3 a + 3 ) = gcd ( 2018 , a 2 3 a + 3 ) \begin{aligned} \gcd \left(a^3-2a^2+2021,a^2-3a+3 \right) &= \gcd \left(a^3-2a^2+2021 - a \times \left(a^2-3a+3 \right),a^2-3a+3 \right) \\ &=\gcd \left(a^2-3a+2021,a^2-3a+3 \right) \\ &=\gcd \left(2018,a^2-3a+3 \right) \end{aligned}

Now, 2018 = 2 × 1009 2018=2 \times 1009 ( 1009 1009 is prime). But a 2 3 a + 3 a^2-3a+3 is always odd; so this gcd \gcd is either 1 1 or 1009 1009 .

Are there any a a such that 1009 1009 divides a 2 3 a + 3 a^2-3a+3 ? As it happens, yes: within the given range, all of { 376 , 636 , 1385 , 1645 } \{376,636,1385,1645\} are solutions (and these are the only ones in the range).

So the sum is 4 × 1009 + 2016 × 1 = 6052 4 \times 1009 + 2016 \times 1 = \boxed{6052} .

Hongqi Wang
Jan 26, 2021

a 2 3 a + 3 a^2 - 3a + 3 must be odd number, and: a 3 2 a 2 + 2021 = ( a + 1 ) ( a 2 3 a + 3 ) + 2 × 1009 g c d ( a 3 2 a 2 + 2021 , a 2 3 a + 3 ) = g c d ( a 2 3 a + 3 , 1009 ) \\ a^3 - 2a^2 + 2021 = (a+1)(a^2 - 3a + 3) + 2 \times 1009 \\ \therefore gcd(a^3 - 2a^2 + 2021, a^2 - 3a + 3) = gcd(a^2 - 3a + 3, 1009)

I guess a 2 3 a + 3 a^2 - 3a + 3 and 1009 are coprime but not get proven yet.

They're not, I'm afraid - try a = 376 a=376 .

Chris Lewis - 4 months, 2 weeks ago

Log in to reply

yes you are right. how do you find out them? it is too tedious by trying one by one.

Hongqi Wang - 4 months, 2 weeks ago

Log in to reply

The handwaving answer is that, as a quadratic, we expect to find two solutions to a 2 3 a + 3 0 ( m o d 1009 ) a^2-3a+3 \equiv 0 \pmod{1009}

in the range 1 a 1009 1 \le a \le 1009 , and another two in 1010 a 2018 1010 \le a \le 2018

and it's easy to verify that neither a 1 a \equiv 1 nor a 2 a \equiv 2 are solutions, so there aren't any additional roots when a = 2019 a=2019 or a = 2020 a=2020 .

Note that the discriminant of the quadratic is non-zero modulo 1009 1009 , so there won't be a repeated root.

This is enough to solve this problem - whatever the four roots are, the sum of the gcds is still 4 × 1009 + 2016 × 1 4 \times 1009 + 2016 \times 1 .

I've been wondering if there's a simple (non-coding) way to find the actual roots; all I can think of is trying to find an integer k k such that a 2 3 a + 3 + 1009 k a^2-3a+3+1009k

has integer roots, but I haven't found a nice way to do this yet.

Chris Lewis - 4 months, 2 weeks ago

Log in to reply

@Chris Lewis Thank you for the explaining.

Hongqi Wang - 4 months, 2 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...