Closed form for a sequence of a language variables
We developed a new language based on some rules: The language limits all variable names to zero or more letters from the set {b, e, d} followed by zero or more digits from the set {0, 1, 2, 3}. In other words, the empty string, b, 12, bed100, and bedb2012 are all legal variable names. However, 1b and be2d are not valid variable names. There is exactly 1 legal variable name of length 0, namely the empty string. There are exactly 7 legal variable names of length 1: b, e, d, 0, 1, 2, and 3. There are exactly 37 legal variable names of length 2: bb, be, bd, b0, b1, b2, b3, eb, ee, ed, e0, e1, e2, e3, db, de, dd, d0, d1, d2, d3, 00, 01, 02, 03, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, and 33. Your task is to find a closed-form expression for the number of legal variable names of length n in the language.
I have tried finding the sequence first so that I can find the closed-form but I am stuck in the first part, can't even go further. Like, the difference between length 0,1,2 is 1,7,37. Every form I take, I can't find the difference d from it. Not only that, how am I supposed to find a closed-form for it?