Sometimes there are some problems where a number n is given and have to output the value of n'th number of some sequence. Like these problems: 1731B - Kill Demodogs 1822C - Bun Lover 166E - Tetrahedron These problems are solvable with equations. I want to know how can we generate formula's for these types of problems .. Thanks in advanced .