# Algorithm for 'good' number

A give number x is 'good' if the sum of any two consecutive digit of the number x are between k and 2k.I need to find an algorithm that for a given number k and a given number n, find how many 'good' n-digit numbers exist.