Put that polynomial into computer! Just do it!

Find the sum of coefficients of the polynomial P ( x ) = ( 3 x 3 + x 2 + 5 x + 2 ) 16 P(x) = (3x^3 + x^2 + 5x + 2)^{16} when P ( x ) P(x) is expanded. Submit your answer in modulo 131.


The answer is 102.

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

Soumava Pal
Feb 19, 2016

Put x=1 to get the sum of the coefficients. So we have (11**16)%131

Bill Bell
Feb 18, 2016

I used sympy to expand the expression, then a regular expression to pick out most of the coefficients. Rather than writing a more complicated regular expression that would be able to find the purely numerical coefficient as well as the others, and knowing that it would be presented at the end, I dug it out using the string method rfind .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from sympy import *
from re import compile

coeffRE=compile('([0-9]+)\*')

var('x')
expr=str(((3*x**3+x**2+5*x+2)**16).expand())

total=sum([int(piece) for piece in coeffRE.findall(expr)])
total+=int(expr[1+expr.rfind(' '):])

print (total%131)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...