Post Reply 
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)
m2=P(m1+1)
N=INT(log(m2)/log(m1))
Dim A(0 to N)
For I = N to 0 Step -1
  K = (m1+1)^I
  A(I) = INT(m2/K)
  m2 = m2 - A(I)*K
Next

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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Math brain teaser - Han - 12-27-2013, 05:18 AM
RE: Math brain teaser - Les_Koller - 12-27-2013, 05:54 AM
RE: Math brain teaser - Les_Koller - 12-27-2013, 07:41 AM
RE: Math brain teaser - Namir - 12-27-2013 01:24 PM
RE: Math brain teaser - Han - 12-27-2013, 05:29 PM
RE: Math brain teaser - Thomas Klemm - 12-27-2013, 05:56 PM
RE: Math brain teaser - Han - 12-27-2013, 06:13 PM
RE: Math brain teaser - Namir - 12-27-2013, 10:02 PM
RE: Math brain teaser - Paul Dale - 12-27-2013, 10:52 PM
RE: Math brain teaser - Thomas Klemm - 12-28-2013, 11:20 AM
RE: Math brain teaser - Han - 12-27-2013, 11:00 PM
RE: Math brain teaser - Les_Koller - 12-28-2013, 02:03 AM
RE: Math brain teaser - Paul Dale - 12-28-2013, 02:45 AM
RE: Math brain teaser - walter b - 12-28-2013, 04:31 AM
RE: Math brain teaser - Thomas Klemm - 12-28-2013, 11:11 AM
RE: Math brain teaser - walter b - 12-28-2013, 12:17 PM
RE: Math brain teaser - Thomas Klemm - 12-28-2013, 12:55 PM
RE: Math brain teaser - Paul Dale - 12-28-2013, 11:58 AM
RE: Math brain teaser - Les_Koller - 12-28-2013, 09:21 PM
RE: Math brain teaser - Thomas Klemm - 12-29-2013, 12:10 AM
RE: Math brain teaser - Les_Koller - 12-29-2013, 01:46 AM
RE: Math brain teaser - Thomas Klemm - 12-29-2013, 08:33 AM
RE: Math brain teaser - Les_Koller - 12-29-2013, 01:50 AM
RE: Math brain teaser - Paul Dale - 12-29-2013, 01:54 AM
RE: Math brain teaser - Thomas Klemm - 12-29-2013, 11:25 AM
RE: Math brain teaser - Les_Koller - 12-29-2013, 01:58 AM
RE: Math brain teaser - Les_Koller - 12-29-2013, 05:52 PM



User(s) browsing this thread: 4 Guest(s)