Generalized Fibonacci sequence