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.

A337127 Table with 10 columns read by rows: T(n, k) is the number of n-digit positive integers with exactly k distinct base 10 digits (0 < k <= 10).

Original entry on oeis.org

9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 81, 0, 0, 0, 0, 0, 0, 0, 0, 9, 243, 648, 0, 0, 0, 0, 0, 0, 0, 9, 567, 3888, 4536, 0, 0, 0, 0, 0, 0, 9, 1215, 16200, 45360, 27216, 0, 0, 0, 0, 0, 9, 2511, 58320, 294840, 408240, 136080, 0, 0, 0, 0, 9, 5103, 195048, 1587600, 3810240, 2857680, 544320, 0, 0, 0
Offset: 1

Views

Author

Stefano Spezia, Aug 17 2020

Keywords

Examples

			The table T(n, k) begins:
9     0      0       0       0       0  0  0  0  0
9    81      0       0       0       0  0  0  0  0
9   243    648       0       0       0  0  0  0  0
9   567   3888    4536       0       0  0  0  0  0
9  1215  16200   45360   27216       0  0  0  0  0
9  2511  58320  294840  408240  136080  0  0  0  0
...
		

Crossrefs

Cf. A010734, A048993, A052268 (row sums), A073531 (diagonal), A180599 (k = 1), A335843 (k = 2), A337313 (k = 3).

Programs

  • Mathematica
    T[n_,k_]:=9Pochhammer[11-k,k-1]/k!*n!*Coefficient[Series[(Exp[x]-1)^k,{x,0,n}],x,n]; Table[T[n,k],{n,7},{k,10}]//Flatten

Formula

T(n, k) = 9*Pochhammer(11-k, k-1)*n! * [x^n] (exp(x) - 1)^k/k!.
T(n, k) = 9*Pochhammer(11-k, k-1) * [x^n] x^k/Product_{j=1..k} (1-j*x).
T(n, k) = 9*Pochhammer(11-k, k-1)*S2(n, k) where S2(n, k) = A048993(n, k) are the Stirling numbers of the 2nd kind.

A337313 a(n) is the number of n-digit positive integers with exactly three distinct base 10 digits.

Original entry on oeis.org

0, 0, 648, 3888, 16200, 58320, 195048, 625968, 1960200, 6045840, 18468648, 56068848, 169533000, 511252560, 1539065448, 4627812528, 13904670600, 41756478480, 125354369448, 376232977008, 1129038669000, 3387795483600, 10164745404648, 30496954122288, 91496298184200
Offset: 1

Views

Author

Stefano Spezia, Aug 22 2020

Keywords

Comments

a(n) is the number of n-digit numbers in A031962.

Examples

			a(1) = a(2) = 0 since the positive integers must have at least three digits;
a(3) = #{xyz in N | x,y,z are three different digits with x != 0} = 9*9*8 = 648;
a(4) = 3888 since #[9999] - #[999] - #(1111*[9]) - A335843(4) - #{xywz in N | x,y,w,z are four different digits with x != 0} = 9999 - 999 - 9 - 567 - 9*9*8*7 = 3888;
...
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{6,-11,6},{0,0,648},26]
  • PARI
    concat([0,0],Vec(648*x^3/(1-6*x+11*x^2-6*x^3)+O(x^26)))

Formula

O.g.f.: 648*x^3/(1 - 6*x + 11*x^2 - 6*x^3).
E.g.f.: 108*(exp(x) - 1)^3.
a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3) for n > 3.
a(n) = 648*S2(n, 3) where S2(n, 3) = A000392(n).
a(n) = 324*(3^(n-1) - 2^n + 1).
a(n) ~ 108 * 3^n.
a(n) = 324*(A000244(n-1) - A000225(n)).
a(n) = A337127(n, 3).

A335756 A cup filling problem starting with 2 empty cups of sizes 3 and n, where a(n) is the number of unreachable states (see details in comments).

Original entry on oeis.org

2, 0, 2, 12, 6, 8, 22, 12, 14, 32, 18, 20, 42, 24, 26, 52, 30, 32, 62, 36, 38, 72, 42, 44, 82, 48, 50, 92, 54, 56, 102, 60, 62, 112, 66, 68, 122, 72, 74, 132, 78, 80, 142, 84, 86, 152, 90, 92, 162, 96, 98, 172, 102, 104, 182, 108, 110, 192, 114, 116, 202, 120, 122, 212, 126, 128, 222
Offset: 0

Views

Author

Wesley Ivan Hurt, Jun 20 2020

Keywords

Comments

Start with 2 empty cups of sizes 3 and n and an unlimited supply of water. For each n, we start with (0,0), which means that both cups are empty, so it takes zero steps to reach that state. We can proceed to other states (i,j) by using one of the 3 operations on each step: "fill", "pour", or "transfer".
(1) To "fill (F)", choose a cup that is not completely full and fill it to its maximum capacity (there is an unlimited supply of water).
(2) To "pour (P)", choose a cup that is not completely empty and pour it all out so that the cup becomes empty.
(3) On a "transfer (T)", one cup is poured into the other. To transfer, choose a nonempty cup to pour from and a nonfull cup to fill up. The amount that is transferred is always the largest possible amount (up to the capacity of the cup being filled).
a(n) gives the number of states, (i,j) with i = 0..3, j = 0..n that cannot be obtained by these operations from (0,0).

Examples

			a(4) = 6; for a(4) we have one cup that can hold 3 units of water and another cup that can hold n = 4 units. Starting with empty cups at (0,0), there are fourteen states that can be reached using the given operations. For example, the state (3,2) can be obtained with the sequence (0,0)->(0,4)->(3,1)->(0,1)->(1,0)->(1,4)->(3,2) by the operations F-T-P-T-F-T. However, there are six states (1,1), (2,1), (1,2), (2,2), (1,3) and (2,3) that cannot be obtained from the three operations. So a(4) = 6.
		

References

  • B. W. Jackson and D. Thoro, Applied Combinatorics with Problem Solving. Addison-Wesley, Reading, MA, 1990, Chap. 1, pp. 5-6.

Crossrefs

Programs

  • Magma
    [2*(n-1)*Sign(n mod 3)+(10*Floor(n/3)+2)*(1-Sign(n mod 3)) : n in [0..100]];
  • Mathematica
    Array[2 #2 (#1 - 1) + (10 Floor[#1/3] + 2)*(1 - #2) & @@ {#, Sign@ Mod[#, 3]} &, 67, 0] (* Michael De Vlieger, Jun 28 2020 *)

Formula

a(n) = 2*(n-1)*sign(n mod 3) + (10*floor(n/3)+2)*(1-sign(n mod 3)).
Conjectures from Colin Barker, Jun 21 2020: (Start)
G.f.: 2*(1 + x^2 + 4*x^3 + 3*x^4 + 2*x^5) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n > 5.
(End)

A337314 a(n) is the number of n-digit positive integers with exactly four distinct base 10 digits.

Original entry on oeis.org

0, 0, 0, 4536, 45360, 294840, 1587600, 7715736, 35244720, 154700280, 661122000, 2773768536, 11487556080, 47136955320, 192126589200, 779279814936, 3149513947440, 12695388483960, 51073849285200, 205172877726936, 823325141746800, 3301203837670200, 13228529919066000
Offset: 1

Views

Author

Stefano Spezia, Sep 26 2020

Keywords

Comments

a(n) is the number of n-digit numbers in A031969.

Examples

			a(1) = a(2) = a(3) = 0 since the positive integers must have at least four digits;
a(4) = #{wxyz in N | w,x,y,z are four different digits with w != 0} = A073531(4) = 4536;
a(5) = 45360 since #[99999] - #[9999] - #(11111*[9]) - A335843(5) - A337313(5) - #{vwxyz in N | v,w,x,y,z are five different digits with v != 0} = 99999 - 9999 - 9 - 1215 - 16200 - 9*9*8*7*6 = 45360;
...
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{10,-35,50,-24},{0,0,0,4536},23]
  • PARI
    concat([0,0,0],Vec(4536*x^4/(1-10*x+35*x^2-50*x^3+24*x^4)+O(x^24)))

Formula

O.g.f.: 4536*x^4/(1 - 10*x + 35*x^2 - 50*x^3 + 24*x^4).
E.g.f.: 189*(exp(x) - 1)^4.
a(n) = 10*a(n-1) - 35*a(n-2) + 50*a(n-3) - 24*a(n-4) for n > 4.
a(n) = 4536*S2(n, 4) where S2(n, 4) = A000453(n).
a(n) = 189*(4^n - 4*3^n + 3*2^(n+1) - 4).
a(n) ~ 189 * 4^n.
a(n) = 189*(A000302(n) - 4*A000244(n) + 3*A000079(n+1) - 4).
a(n) = A337127(n, 4).
Showing 1-4 of 4 results.