### Nishu_Coder's blog

By Nishu_Coder, history, 4 months ago, Guys please don't downvote my blog. I genuinely need the help. My doubt is if I am given a sequence 1,2,4,8,15,26,... Then how to find a closed formula for this series in this case. please help me. I know this is not relevant to cp. But it will genuinely help to understand the mathematical computation regarding solving subproblems.

As far as i have read this involves polynomial fitting. How to solve this by polynomial fitting . please kindly help. Comments (8)
 » You can use The On-Line Encyclopedia of Integer Sequences. For your sequence it gives several variants. For example C(n+1,3) + n + 1.
•  » » I am familiar with this website. But i really want to develop the skill of finding close formulas using polynomial fitting which comes under discrete mathematics. so if you know this skill please kindly help. It might help me in doing mathematical computation. Afterall having mathematical maturity will be essential in solving subproblems and will certainly help me in future contests.
•  » » » 4 months ago, # ^ | ← Rev. 4 →   I have never heard of polynomial fitting before reading this blog. I think it is safe to say this technique is not going to be helpful in CP contests.Edit: My bad, I thought polynomial fitting is completely different from polynomial interpolation, which is useful as it is exact. Lagrange interpolation could be a useful technique in your case.CP blog (keep in mind I haven't read it): https://codeforces.com/blog/entry/82953
•  » » » 4 months ago, # ^ | ← Rev. 2 →   Edit: This is wrongPolynomial fitting only works when the equation is a polynomial. Most of the time in CP the sequence we want to find polynomial cannot be represented as a polynomial. For example the formula $n+1 \choose 3$ $+ n + 1$ that was mentioned above cannot be found with polynomial fitting. More likely than not, trying to use polynomial fitting will result in a false positive that is completely wrong.
•  » » » » 4 months ago, # ^ | ← Rev. 2 →   isn't C(3,n+1)+n+1 a polynomial?????????????????
•  » » » » » It is i was mistaken
•  » » » so if you know this skill please kindly help You know it already: Polynomial Fitting. If you have enough sequence items you can construct first differences sequence, then second differences sequence and so on till you get the sequence with the same numbers (if you couldn't reach such sequence with equal numbers then initially you deal with not polynomial sequence). For your sequence: First diffences: 1, 2, 4, 7, 11 Second differences: 1, 2, 3, 4 Third differences: 1, 1, 1 Now you can assume that the initial sequence is generated by some polynomial with degree $3$: $P(n) = An^3 + Bn^2 + Cn + D$You should determine the coefficients $A$, $B$, $C$ and $D$. With zero value for $n$ you can find offhand that $D = 1$. Substututes values $1, 2, 3$ for variable $n$ you get the following system of equations: $P(1) = A + B + C + 1 = 2$ $P(2) = 8A + 4B + 2C + 1 = 4$ $P(3) = 27A + 8B + 3C + 1 = 8$or $A = \frac{1}{6}, B = 0, C = \frac{5}{6}$Now you have the desired formula.
 » you are write,but wkoframalpha is ahttps://www.wolframalpha.com/input?i2d=true&i=interpolation+1%5C%2844%292%5C%2844%294%5C%2844%298%5C%2844%2915%5C%2844%2926