cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 10 results.

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

Views

Author

Jon E. Schoenfield, Feb 21 2015

Keywords

Comments

Let A(n,k) be the number of strings of n decimal digits that contain at least one string of exactly k consecutive "0" digits (i.e., at least one string of k consecutive "0" digits that is not part of a string of more than k consecutive "0" digits). This sequence gives the values of A(n,k) for k=1.

Examples

			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".
		

Crossrefs

Cf. A255372-A255380 (for cases k=2 through k=10; see Comments).

Programs

  • Mathematica
    LinearRecurrence[{20, -109, 99, -90}, {0, 1, 18, 252}, 30] (* Paolo Xausa, Aug 27 2024 *)
  • PARI
    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

Formula

a(0)=0, a(1)=1, a(n) = 9*(10^(n-2) - a(n-2) + sum_{i=1..n-1} a(i)) for n>=2.
G.f.: x*(x-1)^2/((10*x-1)*(9*x^3-9*x^2+10*x-1)). - Alois P. Heinz, Feb 26 2015
a(n) = 20*a(n-1) - 109*a(n-2) + 99*a(n-3) - 90*a(n-4) for n>3. - Colin Barker, Feb 27 2015
a(n) ~ 10^n. - Stefano Spezia, Aug 28 2024

Extensions

a(0)=0 prepended by Jon E. Schoenfield, Feb 21 2015

A255372 Number of strings of n decimal digits that contain at least one string of exactly 2 consecutive "0" digits.

Original entry on oeis.org

0, 0, 1, 18, 261, 3411, 42057, 499383, 5775480, 65506986, 731953926, 8082054387, 88382960316, 958831580700, 10332164902851, 110698940875149, 1180155371168034, 12527193711780981, 132468636134059128, 1396061253467955315, 14668489189614036627
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 21 2015

Keywords

Examples

			a(2) = 1 because there is only 1 two-digit string that contains the substring "00", i.e., "00" itself.
a(3) = 18 because there are 18 three-digit strings that contain a "00" substring that is not part of a string of three or more consecutive "0" digits; using "+" to represent a nonzero digit, the 18 strings comprise 9 of the form "00+" and 9 of the form "+00". ("000" is excluded.)
a(4) = 261 because there are 261 four-digit strings that contain a "00" substring that is not part of a string of three 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 "00+.", 9*9=81 of the form "+00+", and 10*9=90 of the form ".+00".
a(5) = 3411 because there are 3411 five-digit strings that contain at least one "00" substring that is not part of a string of three or more consecutive "0" digits; using "+" and "." as above, the 3411 strings comprise 9*10*10=900 of the form "00+..", 9*9*10=810 of the form "+00+.", 10*9*9=810 of the form ".+00+", and 99*9=891 that are of the form "..+00" but not of the form "00+00" (since the 9 strings of that latter form were already counted among the 900 of the form "00+..").
		

Crossrefs

Cf. A255371 (for strings with, as it were, "exactly 1 consecutive '0' digit", i.e., a "0" that is not a substring of a longer string of "0" digits) and A255373-A255380 (for strings of exactly k consecutive "0" digits, for the cases k=3 through k=10).

Programs

  • Mathematica
    LinearRecurrence[{20,-100,-9,99,-90},{0,0,1,18,261},30] (* Harvey P. Dale, Jan 01 2021 *)

Formula

a(0) = a(1) = 0, a(2) = 1, a(n) = 9*(10^(n-3) - a(n-3) + Sum_{i=2..n-1} a(i)) for n>=3.
G.f.: x^2*(x-1)^2/((10*x-1)*(9*x^4-9*x^3+10*x-1)). - Alois P. Heinz, Feb 26 2015

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

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Examples

			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+...").
		

Crossrefs

Cf. A255371, A255372 (for the k=1 and k=2 cases of "exactly k consecutive '0' digits"), A255374-A255380 (for the cases k=4 through k=10).

Formula

a(0) = a(1) = a(2) = 0, a(3) = 1, a(n) = 9*(10^(n-4) - a(n-4) + sum_{i=3..n-1} a(i)) for n>=4.
G.f.: x^3*(x-1)^2/((10*x-1)*(9*x^5-9*x^4+10*x-1)). - Alois P. Heinz, Feb 26 2015

A255374 Number of strings of n decimal digits that contain at least one string of exactly 4 consecutive "0" digits.

Original entry on oeis.org

0, 0, 0, 0, 1, 18, 261, 3420, 42300, 503991, 5849757, 66595383, 746925399, 8278904070, 90884885481, 989800742916, 10707460718526, 115168484215116, 1232617054343121, 13135427089598511, 139446180653268195, 1475374347592901460, 15562803326717545290
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Crossrefs

Cf. A255371-A255373 (for the k=1 through k=3 cases of "exactly k consecutive '0' digits"), A255375-A255380 (for the cases k=5 through k=10).

Formula

a(0) = a(1) = a(2) = a(3) = 0, a(4) = 1, a(n) = 9*(10^(n-5) - a(n-5) + sum_{i=4..n-1} a(i)) for n>=5.
G.f.: x^4*(x-1)^2/((10*x-1)*(9*x^6-9*x^5+10*x-1)). - Alois P. Heinz, Feb 26 2015

A255375 Number of strings of n decimal digits that contain at least one string of exactly 5 consecutive "0" digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 18, 261, 3420, 42300, 504000, 5849991, 66599757, 746995383, 8279925399, 90898904070, 989984885400, 10709800740081, 115197460652916, 1232968482968526, 13139617033315116, 139495426762343121, 1475946175849599240, 15569374280153300271
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Crossrefs

Cf. A255371-A255374 (for the k=1 through k=4 cases of "exactly k consecutive '0' digits"), A255376-A255380 (for the cases k=6 through k=10).

Programs

  • Mathematica
    LinearRecurrence[{20,-100,0,0,0,-9,99,-90},{0,0,0,0,0,1,18,261},30] (* Harvey P. Dale, Dec 12 2023 *)

Formula

a(0) = a(1) = ... = a(4) = 0, a(5) = 1, a(n) = 9*(10^(n-6) - a(n-6) + sum_{i=5..n-1} a(i)) for n>=6.
G.f.: x^5*(x-1)^2/((10*x-1)*(9*x^7-9*x^6+10*x-1)). - Alois P. Heinz, Feb 26 2015

A255376 Number of strings of n decimal digits that contain at least one string of exactly 6 consecutive "0" digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 18, 261, 3420, 42300, 504000, 5850000, 66599991, 746999757, 8279995383, 90899925399, 989998904070, 10709984885400, 115199800740000, 1232997460650081, 13139968482902916, 139499617032068526, 1475995426741315116, 15569946175522343121
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Crossrefs

Cf. A255371-A255375 (for the k=1 through k=5 cases of "exactly k consecutive '0' digits"), A255377-A255380 (for the cases k=7 through k=10).

Programs

  • Mathematica
    LinearRecurrence[{20,-100,0,0,0,0,-9,99,-90},{0,0,0,0,0,0,1,18,261},30] (* Harvey P. Dale, Aug 17 2021 *)

Formula

a(0) = a(1) = ... = a(5) = 0, a(6) = 1, a(n) = 9*(10^(n-7) - a(n-7) + sum_{i=6..n-1} a(i)) for n>=7.
G.f.: x^6*(x-1)^2/((10*x-1)*(9*x^8-9*x^7+10*x-1)). - Alois P. Heinz, Feb 26 2015

A255377 Number of strings of n decimal digits that contain at least one string of exactly 7 consecutive "0" digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, 746999991, 8279999757, 90899995383, 989999925399, 10709998904070, 115199984885400, 1232999800740000, 13139997460650000, 139499968482900081, 1475999617032002916, 15569995426740068526
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Crossrefs

Cf. A255371-A255376 (for the k=1 through k=6 cases of "exactly k consecutive '0' digits"), A255378-A255380 (for the cases k=8 through k=10).

Formula

a(0) = a(1) = ... = a(6) = 0, a(7) = 1, a(n) = 9*(10^(n-8) - a(n-8) + sum_{i=7..n-1} a(i)) for n>=8.
G.f.: x^7*(x-1)^2/((10*x-1)*(9*x^9-9*x^8+10*x-1)). - Alois P. Heinz, Feb 26 2015

A255378 Number of strings of n decimal digits that contain at least one string of exactly 8 consecutive "0" digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, 747000000, 8279999991, 90899999757, 989999995383, 10709999925399, 115199998904070, 1232999984885400, 13139999800740000, 139499997460650000, 1475999968482900000, 15569999617032000081
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Crossrefs

Cf. A255371-A255377 (for the k=1 through k=7 cases of "exactly k consecutive '0' digits"), A255379 and A255380 (for the cases k=9 and k=10).

Programs

  • Mathematica
    LinearRecurrence[{20,-100,0,0,0,0,0,0,-9,99,-90},{0,0,0,0,0,0,0,0,1,18,261},30] (* Harvey P. Dale, Mar 26 2022 *)

Formula

a(0) = a(1) = ... = a(7) = 0, a(8) = 1, a(n) = 9*(10^(n-9) - a(n-9) + sum_{i=8..n-1} a(i)) for n>=9.
G.f.: x^8*(x-1)^2/((10*x-1)*(9*x^10-9*x^9+10*x-1)). - Alois P. Heinz, Feb 26 2015

A255379 Number of strings of n decimal digits that contain at least one string of exactly 9 consecutive "0" digits.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, 747000000, 8280000000, 90899999991, 989999999757, 10709999995383, 115199999925399, 1232999998904070, 13139999984885400, 139499999800740000, 1475999997460650000, 15569999968482900000
Offset: 0

Views

Author

Jon E. Schoenfield, Feb 22 2015

Keywords

Crossrefs

Cf. A255371-A255378 (for the k=1 through k=8 cases of "exactly k consecutive '0' digits"), A255380 (for the k=10 case).

Formula

a(0) = a(1) = ... = a(8) = 0, a(9) = 1, a(n) = 9*(10^(n-10) - a(n-10) + sum_{i=9..n-1} a(i)) for n>=10.
G.f.: x^9*(x-1)^2/((10*x-1)*(9*x^11-9*x^10+10*x-1)). - Alois P. Heinz, Feb 26 2015

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

Views

Author

Jon E. Schoenfield, Feb 27 2015

Keywords

Comments

This sequence gives the first k+1 nonzero terms from A255371 (the k=1 case), A255372 (the k=2 case), etc., through A255380 (the k=10 case). Those sequences' definitions concern the number of strings of decimal digits that contain "at least one" string of exactly k consecutive "0" digits; the present sequence omits the words "at least" because, with k >= n, and thus 2k >= k+n, it is not possible to have more than one string of exactly k consecutive "0" digits in a string of k+n digits. (Two strings each having exactly k consecutive "0" digits would have to be separated by at least one nonzero digit, or else they would constitute a single string of exactly 2k consecutive "0" digits.)
Omitting the zero terms of each, A255371 through A255380 begin
1, 18, 252, 3177, 37764, 432315, 4821867, 52767711, ...
1, 18, 261, 3411, 42057, 499383, 5775480, 65506986, ...
1, 18, 261, 3420, 42291, 503757, 5845383, 66525399, ...
1, 18, 261, 3420, 42300, 503991, 5849757, 66595383, ...
1, 18, 261, 3420, 42300, 504000, 5849991, 66599757, ...
1, 18, 261, 3420, 42300, 504000, 5850000, 66599991, ...
1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, ...
1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, ...
1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, ...
1, 18, 261, 3420, 42300, 504000, 5850000, 66600000, ...
and the terms of this present sequence give the limiting value for each column.

Examples

			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".
		

Crossrefs

Programs

  • PARI
    Vec((x-1)^2/(10*x-1)^2 + O(x^100)) \\ Colin Barker, Feb 27 2015

Formula

a(0) = 1, a(n) = (81n + 99) * 10^(n-2) for n >= 1.
G.f.: (x-1)^2/(10*x-1)^2. - Alois P. Heinz, Feb 27 2015
a(n) = 20*a(n-1) - 100*a(n-2) for n>2. - Colin Barker, Feb 27 2015
Showing 1-10 of 10 results.