A328916 Number of n-digit decimal numbers containing 123 as a substring.
0, 0, 0, 1, 19, 280, 3699, 45971, 549430, 6390601, 72860039, 818050960, 9074118999, 99668329951, 1085865248550, 11749578366501, 126396115335059, 1352875288102040, 14417003302653899, 153043636911203931, 1619083493823937270, 17076417934936718801
Offset: 0
Examples
For n=6, there are a(6)=3699 six-digit numbers that contain 123 as a substring.
Links
- Michael Gutierrez, Table of n, a(n) for n = 0..997
Crossrefs
Cf. A322628.
Programs
-
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)
Formula
a(n) = 10*a(n-1) + 9*10^(n-4) - a(n-3).
Comments