Math brain teaser
|
12-27-2013, 01:24 PM
(This post was last modified: 12-27-2013 02:33 PM by Namir.)
Post: #4
|
|||
|
|||
RE: Math brain teaser
We evaluate the polynomial at m1=P(1) and m2=P(m1+1). The value m1 gives us the sum of the polynomial coefficients. We use that value to breakdown the value of m2 into the polynomial coefficients using integer divisions and modulo operators (or equivalent operations). Here is a pseudo code for the solution:
Code: m1=P(1) P(x) is the polynomial with the given positive integer coefficients evaluated at X. The array A() contains the calculated polynomial coefficients, such that: P(X,A) = A(0) + A(1)*X + A(2)*X^2 + ... + A(N)*X^N |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)