Ask Your Question

Revision history [back]

Is the exact answer needed? I guess not, since the coefficients are given in floating point. Then an estimate with five significant digits should do. This is usually done symbolically by constructing the (rational) generating function of the recurrence, computing the roots of the denominator polynomial, and from the largest root r the asymptotics which is of form c*r^n for linear recurrences. This can be done manually, with Sage performing these step by step, or (when you have the g.f.) using code from ticket #10519. For examples see my paper.

However, even more simple, but without getting any asymptotics as byproduct, would be to use matrix exponentiation.

Is the exact answer needed? I guess not, since the coefficients are given in floating point. Then an estimate with five significant digits should do. This is usually done symbolically by constructing the (rational) generating function of the recurrence, computing the roots of the denominator polynomial, and from the largest root r the asymptotics which is of form c*r^n for linear recurrences. This can be done manually, with Sage performing these step by step, or (when you have the g.f.) using code from ticket #10519. For examples see my paper.

However, even more simple, but without getting any asymptotics as byproduct, would be to use matrix exponentiation.exponentiation. See for example http://fusharblog.com/solving-linear-recurrence-for-programming-contest/. This looks like a Project Euler question anyway.