
Ask HN: Can you work this out?  What do you think of the puzzle? - ColinWright
I recently asked a question on Twitter and Mastodon and have had some interesting responses.  I&#x27;d very much like to ask this particular community ...<p>Choose a polynomial p(x) with <i>non-negative integer coefficients.</i>  Now choose an integer x that&#x27;s larger than all the coefficients and evaluate p(x).  You tell me x and p(x), and I tell you the polynomial.<p>So ...<p>Do you find this interesting?  Can you work out how to do it?<p>Please don&#x27;t give it away - by all means make it clear that you know how to do it (if you do!) but <i>please</i> don&#x27;t spoil it for the others.<p>But mostly I&#x27;m interested in knowing (eventually) <i>how</i> you think about it.<p>I look forward to your answers (assuming there are any ...)
======
gus_massa
No spoiler version: Ok, nice.

Are you going to ask again in the future for solutions?

~~~
ColinWright
I might - currently it doesn't seem to be getting any attention, so it's not
clear that anyone cares. I'll see if there's more discussion.

 _Added in edit ..._

I now have two distinct solutions (obviously related) and a few different ways
of expressing what they are. But the lack of activity here means there's
little point in coming and asking for solutions. I will be blogging about it
in a while.

------
jonsen
It's Diophantastic interesting.

Yes, I think I can work it out. Might take some time...

------
bufferoverflow
(del)

~~~
ColinWright
Sure I can, because x has to be bigger than all the coefficients, eliminating
both options. In fact you can't use x=1 unless your polynomial is exactly 0.

 _(For those wondering what happened, it 's really easy to mis-read the
conditions - lots of people do.)_

~~~
bufferoverflow
You're right.

------
bufferoverflow
x = 1, p(x) -> 1

p(x) = 0.3x + 0.7x²

p(x) = 0.5x + 0.5x²

~~~
ColinWright
Coefficients have to be non-negative integers.

~~~
bufferoverflow
Your text doesn't mention integers.

~~~
ColinWright
Damn. That might be a typo - stand by.

 _(pause)_

You were right, that was a typo, I've edited it to insert the missing word.

Thank you for finding that error. I've also changed it to say that x has to be
an integer.

