A255371
Number of strings of n decimal digits that contain at least one "0" digit that is not part of a string of two or more consecutive "0" digits.
Original entry on oeis.org
0, 1, 18, 252, 3177, 37764, 432315, 4821867, 52767711, 569171142, 6070198824, 64154357361, 673034324472, 7017585817887, 72795938474871, 751858421307975, 7736579039166894, 79354228046171004, 811679794900979769, 8282239107946760700, 84331460977774328115
Offset: 0
a(1) = 1 because there is only 1 one-digit string that contains a "0" digit, i.e., "0" itself.
a(2) = 18 because there are 18 two-digit strings that contain a "0" digit that is not part of a string of two or more consecutive "0" digits; using "+" to represent a nonzero digit, the 18 strings comprise 9 of the form "0+" and 9 of the form "+0". ("00" is excluded.)
a(3) = 252 because there are 252 three-digit strings that contain at least one "0" digit that is not part of a string of two or more consecutive "0" digits; using "+" as above, the 252 strings comprise 81 of the form "0++", 81 of the form "+0+", 81 of the form "++0", and 9 of the form "0+0".
-
LinearRecurrence[{20, -109, 99, -90}, {0, 1, 18, 252}, 30] (* Paolo Xausa, Aug 27 2024 *)
-
concat(0, Vec(x*(x-1)^2/((10*x-1)*(9*x^3-9*x^2+10*x-1)) + O(x^100))) \\ Colin Barker, Feb 27 2015
A322628
Number of n-digit decimal numbers containing a fixed 2-digit integer with distinct digits as a substring.
Original entry on oeis.org
0, 0, 1, 19, 279, 3671, 45431, 540639, 6260959, 71068951, 794428551, 8773216559, 95937737039, 1040604153831, 11210103801271, 120060433858879, 1279394234787519, 13573881914016311, 143459424905375591, 1511020367139739599, 15866744246492020399
Offset: 0
-
a:=[0,1,19];; for n in [4..20] do a[n]:=20*a[n-1]-101*a[n-2]+10*a[n-3]; od; Concatenation([0],a); # Muniru A Asiru, Dec 21 2018
-
seq(coeff(series(x^2*(x-1)/((10*x-1)*(x^2-10*x+1)),x,n+1), x, n), n = 0 .. 20); # Muniru A Asiru, Dec 21 2018
-
concat([0,0], Vec(x^2*(x-1)/((10*x-1)*(x^2-10*x+1)) + O(x^30))) \\ Colin Barker, Dec 21 2018
-
def find_int(i):
if i == 0: return (0)
intlist = [0,1,19]
for n in range(4,i+2):
if n > 3:
a = 10*(intlist[n-2])+(9*10**(n-3)-intlist[n-3])
intlist.append(a)
return (intlist[i-1])
for i in range(100):
print(find_int(i), end=', ')
A255373
Number of strings of n decimal digits that contain at least one string of exactly 3 consecutive "0" digits.
Original entry on oeis.org
0, 0, 0, 1, 18, 261, 3420, 42291, 503757, 5845383, 66525399, 745904151, 8264888316, 90700808526, 987461965116, 10678505242392, 114817381566435, 1228431892382460, 13086248073415290, 138875261344657416, 1468815363559657773, 15488131104999233505
Offset: 0
a(3) = 1 because there is only 1 three-digit string that contains the substring "000", i.e., "000" itself.
a(4) = 18 because there are 18 four-digit strings that contain a "000" substring that is not part of a string of four or more consecutive "0" digits; using "+" to represent a nonzero digit, the 18 strings comprise 9 of the form "000+" and 9 of the form "+000". ("0000" is excluded.)
a(5) = 261 because there are 261 five-digit strings that contain a "000" substring that is not part of a string of four or more consecutive "0" digits; using "+" as above and "." to denote any digit (0 or otherwise), the 261 strings comprise 9*10=90 of the form "000+.", 9*9=81 of the form "+000+", and 10*9=90 of the form ".+000".
a(6) = 3420 because there are 3420 six-digit strings that contain a "000" substring that is not part of a string of four or more consecutive "0" digits; using "+" and "." as above, the 3420 strings comprise 9*10*10=900 of the form "000+..", 9*9*10=810 of the form "+000+.", 10*9*9=810 of the form ".+000+", and 10*10*9=900 of the form "..+000".
a(7) = 42291 because there are 42291 seven-digit strings that contain at least one "000" substring that is not part of a string of four or more consecutive "0" digits; using "+" and "." as above, the 42291 strings comprise 9*10*10*10=9000 of the form "000+...", 9*9*10*10=8100 of the form "+000+..", 10*9*9*10=8100 of the form ".+000+.", 10*10*9*9=8100 of the form "..+000+", and 999*9=8991 that are of the form "...+000" but not of the form "000+000" (since 9 strings of that latter form were already counted among the 9000 of the form "000+...").
A255381
Number of strings of k+n decimal digits that contain one string of exactly k consecutive "0" digits, where k >= n.
Original entry on oeis.org
1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, 747000000, 8280000000, 90900000000, 990000000000, 10710000000000, 115200000000000, 1233000000000000, 13140000000000000, 139500000000000000, 1476000000000000000, 15570000000000000000, 163800000000000000000
Offset: 0
Trivially, a(0)=1 because there is 1 string of k decimal digits that contains one string of exactly k consecutive "0" digits, where k >= 0: namely, the string of k consecutive "0" digits itself.
a(1)=18 because there are 18 strings of k+1 decimal digits that contain one string of exactly k consecutive "0" digits, where k >= 1. Letting "S" and "+" represent the string of exactly k consecutive "0" digits and any nonzero digit, respectively, the 18 strings comprise 9 of the form "S+" and 9 of the form "+S".
a(2)=261 because there are 261 strings of k+2 decimal digits that contain one string of exactly k consecutive "0" digits, where k >= 2. Letting "S", "+", and "." represent the string of exactly k consecutive "0" digits, any nonzero digit, and any digit (zero or nonzero), respectively, the 261 strings comprise 9*10=90 of the form "S+.", 9*9=81 of the form "+S+", and 10*9=90 of the form ".+S".
a(3)=3420 because there are 3420 strings of k+3 decimal digits that contain one string of exactly k consecutive "0" digits, where k >= 3. Using "S", "+", and "." as above, the 3420 strings comprise 9*10*10=900 of the form "S+..", 9*9*10=810 of the form "+S+.", 10*9*9=810 of the form ".+S+", and 10*10*9=900 of the form "..+S".
A365137
a(n) is the number of n-digit numbers that contain '22' in their decimal representation.
Original entry on oeis.org
0, 0, 1, 18, 261, 3411, 42048, 499131, 5770611, 65427678, 730784601, 8065910511, 88170256008, 956125498671, 10298661792111, 110293085617038, 1175325726682341, 12470569310694411, 131813055336390768, 1388552621823766611, 14583291094441416411, 152746593446386647198
Offset: 0
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.
-
A365137 := proc(n) option remember; if n <= 1 then 0; elif n = 2 then 1; elif n = 3 then 18; else 19*procname(n - 1) - 81*procname(n - 2) - 90*procname(n - 3); end if; end proc; seq(A365137(n), n = 0 .. 21);
-
LinearRecurrence[{19, -81, -90}, {0, 0, 1, 18}, 22] (* Robert P. P. McKone, Aug 24 2023 *)
Showing 1-5 of 5 results.
Comments