20
2
We know that f is a polynomial with non-negative integer coefficients.
Given f(1) and f(1+f(1)) return f. You may output f as a list of coefficients, an ASCII formatted polynomial, or similar.
Examples:
f(1) f(1+f(1)) f
0 0 0
1 1 1
5 75 2x^2 + 3
30 3904800 4x^4 + 7x^3 + 2x^2 + 8x + 9
1 1073741824 x^30
1Random question: I'm too tired to try to prove/disprove this right now, but is it guaranteed that we will always be able to get an answer from
f(1)
andf(1+f(1))
? – HyperNeutrino – 2017-03-30T03:13:53.3674@HyperNeutrino I wouldn't have made this challenge otherwise. – orlp – 2017-03-30T03:16:41.560
Right, that is a good point. Hm. Interesting, I will look into proving that tomorrow because that's very interesting. Thanks for the interesting challenge! – HyperNeutrino – 2017-03-30T03:18:54.563
1The [tag:base-conversion] tag is supposed to be a hint? – Thunda – 2017-03-30T03:25:36.020
9As much as this is a cute puzzle, I think the code is basically base conversion. Possibly dupe? – xnor – 2017-03-30T03:34:02.337