OFFSET
0,5
COMMENTS
See A322628 for the number of n-digit decimal numbers containing 12 as a substring.
LINKS
Michael Gutierrez, Table of n, a(n) for n = 0..997
FORMULA
a(n) = 10*a(n-1) + 9*10^(n-4) - a(n-3).
EXAMPLE
For n=6, there are a(6)=3699 six-digit numbers that contain 123 as a substring.
PROG
(Python)
a = [0, 0, 0, 1]
for i in range(0, 18):
a.append(10 * a[len(a) - 1] + 9 * 10 ** (len(a) - 4) - a[len(a) - 3])
print(a)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Michael Gutierrez, Oct 30 2019
STATUS
approved