Remainder of a sum modulo 211

Let f ( x ) = ( x 3 + x + 2 ) 71 f(x)=(x^3+x+2)^{71} . Find the remainder when f ( 0 ) + f ( 1 ) + f ( 2 ) + + f ( 210 ) f(0)+f(1)+f(2)+\cdots+f(210) is divided by 211 211 .


The answer is 69.

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

David Popovic
Oct 28, 2013

This is a simple solution in python

#python 2.7
def f(x):
return ((x**3 + x + 2)**71) % 211

v = 0
for a in range (211):
    v = v + f(a)

print v % 211

The point of the Number Theory section is to work on your Math Skills, not your Programming skills. Nice little program, but even I can do that. No offense.

Ahaan Rungta - 7 years, 7 months ago

Log in to reply

Yes, I know, but I read somewhere that programming solutions are also acceptable :) Can I see your (or someone's) mathematical solution?

David Popovic - 7 years, 7 months ago

Use that for prime p and n that is not divisible by p-1 we have p i = 1 p 1 i n p\mid\sum_{i=1}^{p-1}i^n

Maksim Stokic - 7 years, 7 months ago

Log in to reply

It's great that you identified the most important aspect of the proof. Can you explain why this is true?

Calvin Lin Staff - 7 years, 7 months ago

Log in to reply

On the contrary, assume there exists a positive integer n n such that p 1 ∤ n p-1 \not \mid n , but p k = 0 p 1 k n p \mid \sum \limits_{k=0}^{p-1} k^n . Let n n be the smallest positive integer satisfying this property. We write n = m × ( p 1 ) + r n= m \times (p-1) + r , where m 0 m \geq 0 and 0 r < p 1 0 \leq r < p-1 by the division algorithm. Then, note that k = 0 p 1 k n = k = 0 p 1 k m × ( p 1 ) + r \sum \limits_{k=0}^{p-1} k^n = \sum \limits_{k=0}^{p-1} k^{ m \times (p-1) + r} = k = 0 p 1 ( k p 1 ) m × k r k = 0 p 1 k r ( m o d p ) = \sum \limits_{k=0}^{p-1} \left ( k^{p-1} \right )^m \times k^r \equiv \sum \limits_{k=0}^{p-1} k^r \pmod{p} where the last step follows from Fermat's Little Theorem. This shows that if n n satisfies the condition, so does r r . Since n n is the smallest positive integer satisfying this condition, either r = 0 r=0 or r = n r=n . However, r = 0 p 1 n r=0 \implies p-1 \mid n , a contradiction. So we must have m = 0 m=0 , n = r n=r . Also note that this implies 1 n < p 1 1 \leq n < p-1 . For all smaller integers i i , p p must divide k = 0 p 1 k i \sum \limits_{k=0}^{p-1} k^i . From Pascal's identity, we have k = 0 n ( n + 1 k ) ( 1 k + 2 k + + p k ) = ( p + 1 ) n + 1 1 \sum \limits_{k=0}^{n} \binom{n+1}{k} (1^k + 2^k + \cdots + p^k)= (p+1)^{n+1}-1 k = 0 n 1 ( n + 1 k ) ( 1 k + 2 k + + p k ) + ( n + 1 n ) ( 1 n + 2 n + + p n ) = ( p + 1 ) n + 1 1 \implies \sum \limits_{k=0}^{n-1} \binom{n+1}{k} (1^k + 2^k + \cdots + p^k) + \binom{n+1}{n} (1^n + 2^n + \cdots + p^n) = (p+1)^{n+1}-1 Note that ( p + 1 ) n + 1 1 1 1 0 ( m o d p ) (p+1)^{n+1}-1 \equiv 1 -1 \equiv 0 \pmod{p} , and also note that k = 0 n 1 ( n + 1 k ) ( 1 k + 2 k + + p k ) 0 ( m o d p ) \sum \limits_{k=0}^{n-1} \binom{n+1}{k} (1^k + 2^k + \cdots + p^k) \equiv 0 \pmod{p} . Hence we must have ( n + 1 ) ( 1 n + 2 n + . . . + p n ) 0 ( m o d p ) (n+1)(1^n+2^n+...+ p^n) \equiv 0 \pmod{p} . But p > n + 1 p>n+1 from our previous observation, so gcd ( n + 1 , p ) = 1 \gcd (n+1, p)= 1 , implying p 1 n + 2 n + + ( p 1 ) n p \mid 1^n + 2^n + \cdots + (p-1)^n , a contradiction. This proves our claim. QED

The rest of the analysis is trivial. Let c n c_{n} denote the coefficient of x n x^n in ( x 3 + x + 2 ) 71 (x^3+x+2)^{71} . The given sum can be rearranged as n = 0 71 × 3 c n ( 1 n + 2 n + + 21 0 n ) \sum \limits_{n=0}^{71 \times 3} c_n (1^n + 2^n + \cdots + 210^n) From our claim, all other terms leave no remainder when divided by 211 211 other than c 210 × ( 1 210 + 2 210 + + 21 0 210 ) c_{210} \times (1^{210} + 2^{210} + \cdots + 210^{210}) and c 0 × ( 1 0 + 2 0 + + 21 0 210 ) c_{0} \times (1^0 + 2^0 + \cdots + 210^{210}) By Fermat's Little theorem, 1 210 + 2 210 + + 21 0 210 1 + 1 + + 1 210 1 ( m o d 211 ) 1^{210} + 2^{210} + \cdots + 210^{210} \equiv 1 + 1 + \cdots + 1 \equiv 210 \equiv -1 \pmod{211} Again, c 0 × ( 1 0 + 2 0 + + 21 0 210 ) c 0 × ( 1 + 1 + + 1 ) c 0 ( m o d 211 ) c_{0} \times (1^0 + 2^0 + \cdots + 210^{210} ) \equiv c_0 \times (1+1+\cdots + 1) \equiv -c_0 \pmod{211} Our desired remainder equals 1 × ( c 0 + c 210 ) ( m o d 211 ) -1 \times (c_0 + c_{210}) \pmod{211} An easy check shows that c 0 + c 210 142 ( m o d 211 ) c_0 + c_{210} \equiv 142 \pmod{211} . Our desired remainder will then be: 142 ( m o d 211 ) 69 ( m o d 211 ) -142 \pmod{211} \equiv 69 \pmod{211}

Sreejato Bhattacharya - 7 years, 7 months ago

Sum of first 210 numbers is divisible by 211. Also the sum of first 210 squares, cubes, 4th powers and so on(including 211th powers and 213th powers) are divisible by 211, except 210th powers which leave a remainder 1 individually when divided by 211 (Fermat's Little Theorem). So the remainder is sum of all the coefficients of the 210th powers i.e. 210x71x2 which is equivalent to 69 modulo 211.

Abhay Gupta - 7 years, 7 months ago

Log in to reply

Can you explain why this is true?

Calvin Lin Staff - 7 years, 7 months ago

Log in to reply

Frankly no. It is true for sum of first n 1st,2nd and 3rd powers (evident from the formulas), if n+1 is a prime number. And I just extrapolated it to all integer powers. For odd powers it is obvious because the remainders from a^n and (211-a)^n will cancel. But for even powers I am not sure why.

Abhay Gupta - 7 years, 7 months ago

I saw this from Paulo Ribenboim's book, The Little Book of Bigger Primes , page 18:

Let p p be any odd prime, k 1 k\geq1 , and S = j = 1 p 1 j k S=\sum_{j=1}^{p-1} j^{k} . Then S S is congruent to 1 m o d p -1 mod p when p 1 k p-1|k , and 0 m o d p 0 mod p otherwise.

Nathanael Joshua Balete - 7 years, 7 months ago

I used Mathematica:

Mod[Sum[((x - 1)^3 + (x - 1) + 2)^71, {x, 211}], 211]

Nathanael Joshua Balete - 7 years, 7 months ago

Log in to reply

PARI for me. Apparently it's extremely fast with number theory computations

Edward Jiang - 7 years, 7 months ago

It's possible to do this with an Excel bash. Set up a column of the integers 0 0 to 210 210 and the values of x 3 + x + 2 x^3+x+2 . Take this value m o d 211 \mod 211 (this is the m o d mod column; the next 71 71 columns to the right are the m o d n mod^n columns). If you make each m o d n mod^n column the product of the m o d n 1 mod^{n-1} column and the m o d mod column, taken m o d 211 \mod211 , you can get the value for ( x 3 + x + 2 ) 71 m o d 211 (x^3+x+2)^{71}\mod211 for a specific x x . Repeating this for x [ 0 , 210 ] x\in[0,210] and setting up a cell to take the sum of the entries in the m o d 71 mod^{71} column yields a value of 19 , 692 19,692 . 19 , 692 m o d 211 = 69 m o d 211 19,692\mod211=69\mod211 , so the answer is 69 \boxed{69} .

When I did this, I noticed an interesting phenomenon. Each of the values in the m o d 70 mod^{70} column was either 0 0 , 1 1 , 14 14 , or 196 196 . Several other columns had lots of repeated terms too. Can someone please explain why this is? Thanks.

Trevor B. - 7 years, 7 months ago

Log in to reply

For your observation regarding ( m o d 70 ) \pmod{70} , notice that 1 4 3 = 2744 1 ( m o d 211 ) 14^3 = 2744 \equiv 1 \pmod{211} , 1, 14 and 196 are the 'cube roots' of 1 modulo 211, i.e. integers which satisfy x 3 1 ( m o d 211 ) x^3 \equiv 1 \pmod{211} .

Because 211 is a prime, the non-zero residues form a cyclic group under multiplication. Since we know from FLT that a 210 1 ( m o d 211 ) a^{210} \equiv 1 \pmod{211} , the values of a 70 a^{70} would only be the 3 cube roots. Apply this to a = x 3 + x + 2 a = x^3 + x + 2 , and the only possible non-zero values are 1 , 14 , 196 1, 14, 196 . As it turns out, all of them are achievable.

Of course, it could be 0 if x 3 + x + 2 0 ( m o d 211 ) x^3 + x + 2 \equiv 0 \pmod{211} .

Calvin Lin Staff - 7 years, 7 months ago

def f(x):
    return ((x**3) + x + 2)**71

bigSum = 0
i=0
while i < 211:
    bigSum = bigSum + f(i)
    i=i+1

print "bigSum MOD 211",(bigSum % 211)

Angel Leon - 7 years, 7 months ago

wonder how that worked, if you f(x) was already doing the 211, and then you re-did the modulus 211 with the final result.

Angel Leon - 7 years, 7 months ago

Log in to reply

I used m o d 211 \mod 211 in f ( x ) f(x) to avoid huge numbers. Since we really care only about residues m o d 211 \mod 211 it is completelly OK to do this. The programm would theoretically also work if you removed the m o d 211 \mod 211 part in the function.

David Popovic - 7 years, 7 months ago

Hahaha, I did the same!

Luke Nelson - 7 years, 7 months ago
Luke Nelson
Nov 3, 2013

Throw this into python.

c=0

for x in range (0, 211):

c+=(((x^3)+x+2)^71)"^ should be **"

print (c%211)

69 \boxed{69}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...