OFFSET
0,4
COMMENTS
a(n) is also valid for '11', '33', '44', '55', '66', '77', '88' or '99' instead of '22'.
LINKS
Felix Huber, Table of n, a(n) for n = 0..996
Armin Widmer, The number of Licence Plates that contain '22'
Index entries for linear recurrences with constant coefficients, signature (19,-81,-90).
FORMULA
a(n) = 19*a(n - 1) - 81*a(n - 2) - 90*a(n - 3) with a(0) = a(1) = 0, a(2) = 1 and a(3) = 18 for n >= 4.
a(0) = 0, a(n) = 9*10^(n - 1) - (p^(n + 1) - q^(n + 1))/(3*sqrt(13)) + (p^(n - 1) - q^(n - 1))/(3*sqrt(13)) with p = (9 + 3*sqrt(13))/2 and q = (9 - 3*sqrt(13))/2 for n >= 1.
G.f.: x^2*(1 - x)/((1 - 10*x)*(1 - 9*x - 9*x^2)).
a(n) = A255372(n) for n <= 5.
EXAMPLE
a(2) = 1, the number 22 itself.
a(3) = 18, 10 numbers 22X plus 9 numbers X22 minus 1 number 222.
a(4) = 261, 100 numbers 22XX plus 90 numbers X22X plus 90 numbers XX22 minus 10 numbers 222X minus 9 numbers X222.
MAPLE
MATHEMATICA
LinearRecurrence[{19, -81, -90}, {0, 0, 1, 18}, 22] (* Robert P. P. McKone, Aug 24 2023 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Felix Huber, Aug 23 2023
STATUS
approved