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-4 of 4 results.

A322052 Number of decimal strings of length n that contain a specific string xy where x and y are distinct digits.

Original entry on oeis.org

0, 1, 20, 299, 3970, 49401, 590040, 6850999, 77919950, 872348501, 9645565060, 105583302099, 1146187455930, 12356291257201, 132416725116080, 1411810959903599, 14985692873919910, 158445117779295501, 1669465484919035100, 17536209731411055499, 183692631829191519890, 1919390108560504143401
Offset: 1

Views

Author

N. J. A. Sloane, Dec 21 2018

Keywords

Comments

See A004189 for the number that do not contain the specified string.

Examples

			Suppose the desired string is 03. At length 2 that is the only possibility. At length 3 there are 20 strings that contain it: 03d and d03, where d is any digit.
		

Crossrefs

Partial sums of A322628.

Programs

  • Maple
    f:= gfun:-rectoproc({10*a(n) - 101*a(n + 1) + 20*a(n + 2) - a(n + 3), a(0) = 0, a(1) = 0, a(2) = 1},a(n),remember):
    map(f, [$1..40]); # Robert Israel, Mar 27 2020

Formula

G.f.: x^2/((1-10*x)*(1-10*x+x^2)).

A322054 Number of decimal strings of length n that do not contain a specific string xx (where x is a single digit).

Original entry on oeis.org

10, 99, 981, 9720, 96309, 954261, 9455130, 93684519, 928256841, 9197472240, 91131561729, 902961305721, 8946835807050, 88648174014939, 878355088397901, 8703029361715560, 86232460051021149, 854419404714630381, 8465866782890863770
Offset: 1

Views

Author

N. J. A. Sloane, Dec 21 2018

Keywords

Comments

See A322053 for the number that do contain the specified string.

Examples

			Suppose the string is 00. At length 2 there are 99 strings that do not contain it. At length 3 there are 19 strings that do not contain it, 000, 00x, and x00, where x is any nonzero digit. So a(3) = 1000-19 = 981.
		

Crossrefs

Suggested by A322628.

Programs

  • Mathematica
    T[n_, k_] := LinearRecurrence[{n - 1, n - 1}, {n, n^2 - 1}, k];
    T[10, {1, 19}] (* Robert P. P. McKone, Dec 31 2020 *)

Formula

G.f.: x*(10+9*x)/(1-9*x-9*x^2).
a(n) = 9*a(n-1) + 9*a(n-2) for n >= 3.

A322053 Number of decimal strings of length n that contain a specific string xx (where x is a single digit).

Original entry on oeis.org

0, 1, 19, 280, 3691, 45739, 544870, 6315481, 71743159, 802527760, 8868438271, 97038694279, 1053164192950, 11351825985061, 121644911602099, 1296970638284440, 13767539948978851, 145580595285369619, 1534133217109136230, 16117424311550552641
Offset: 1

Views

Author

N. J. A. Sloane, Dec 21 2018

Keywords

Comments

See A322054 for the number that do not contain the specified string.

Examples

			Suppose the desired string is 00. At length 2 that is the only possibility. At length 3 there are 19 strings that contain it: 000, 00d, and d00, where d is any nonzero digit.
		

Crossrefs

Suggested by A322628.

Formula

G.f. = x^2/((1-10*x)*(1-9*x-9*x^2)).

A328916 Number of n-digit decimal numbers containing 123 as a substring.

Original entry on oeis.org

0, 0, 0, 1, 19, 280, 3699, 45971, 549430, 6390601, 72860039, 818050960, 9074118999, 99668329951, 1085865248550, 11749578366501, 126396115335059, 1352875288102040, 14417003302653899, 153043636911203931, 1619083493823937270, 17076417934936718801
Offset: 0

Views

Author

Michael Gutierrez, Oct 30 2019

Keywords

Comments

See A322628 for the number of n-digit decimal numbers containing 12 as a substring.

Examples

			For n=6, there are a(6)=3699 six-digit numbers that contain 123 as a substring.
		

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).
Showing 1-4 of 4 results.