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.

A285268 Triangle read by rows: T(m,n) = Sum_{i=1..n} P(m,i) where P(m,n) = m!/(m-n)! is the number of permutations of m items taken n at a time, for 1 <= n <= m.

Original entry on oeis.org

1, 2, 4, 3, 9, 15, 4, 16, 40, 64, 5, 25, 85, 205, 325, 6, 36, 156, 516, 1236, 1956, 7, 49, 259, 1099, 3619, 8659, 13699, 8, 64, 400, 2080, 8800, 28960, 69280, 109600, 9, 81, 585, 3609, 18729, 79209, 260649, 623529, 986409, 10, 100, 820, 5860, 36100, 187300, 792100, 2606500, 6235300, 9864100
Offset: 1

Views

Author

Rick Nungester, Apr 15 2017

Keywords

Comments

T(m, n) is the total number of ordered sets of size 1 to n that can be created from m distinct items. For example, for 4 items taken 1 to 3 at a time, there are P(4, 1) + P(4, 2) + P(4, 3) = 4 + 12 + 24 = 40 total sets: 1, 12, 123, 124, 13, 132, 134, 14, 142, 143, 2, 21, 213, 214, 23, 231, 234, 24, 241, 243, 3, 31, 312, 314, 32, 321, 324, 34, 341, 342, 4, 41, 412, 413, 42, 421, 423, 43, 431, 432.
T(m, n) is the total number of tests in a software program that generates all P(m, n) possible solutions to a problem, allowing early-termination testing on each partial permutation, and not doing any such early termination. For example, from a deck of 52 cards, evaluate all possible 5-card deals as each card is dealt. T(52, 5) = 318507904 total evaluations.
T(m, n) counts the numbers with <= n distinct nonzero digits in base m+1. - M. F. Hasler, Oct 10 2019

Examples

			Triangle begins:
  1;
  2,  4;
  3,  9,  15;
  4, 16,  40,   64;
  5, 25,  85,  205,   325;
  6, 36, 156,  516,  1236,  1956;
  7, 49, 259, 1099,  3619,  8659,  13699;
  8, 64, 400, 2080,  8800, 28960,  69280, 109600;
  9, 81, 585, 3609, 18729, 79209, 260649, 623529, 986409;
  ...
		

Crossrefs

Mirror of triangle A121662.
Row sums give A030297.
Diagonals (1..4): A007526 (less the initial 0), A038156 (less the initial 0, 0), A224869 (less the initial -1, 0), A079750 (less the initial 0).
Columns (1..3): A000027, A000290 (less the initial 0, 1), A053698 (less the initial 1, 4).

Programs

  • Maple
    SumPermuteTriangle := proc(M)
      local m;
      for m from 1 to M do print(seq(add(m!/(m-k)!, k=1..n), n=1..m)) od;
    end:
    SumPermuteTriangle(10);
    # second Maple program:
    T:= proc(n, k) option remember;
         `if`(k<1, 0, T(n-1, k-1)*n+n)
        end:
    seq(seq(T(n, k), k=1..n), n=1..10);  # Alois P. Heinz, Jun 26 2022
  • Mathematica
    Table[Sum[m!/(m - i)!, {i, n}], {m, 9}, {n, m}] // Flatten (* Michael De Vlieger, Apr 22 2017 *)
    (* Sum-free code *)
    b[j_] = If[j==0, 0, Floor[j! E - 1]]; T[m_,n_] = b[m] - m! b[m-n]/(m-n)!; Table[T[m, n],{m, 24},{n, m}]//Flatten
    (* Manfred Boergens, Jun 22 2022 *)
  • PARI
    A285268(m,n,s=m-n+1)={for(k=m-n+2,m,s=(s+1)*k);s} \\ Much faster than sum(k=1,n,m!\(m-k)!), e.g., factor 6 for m=1..99, factor 57 for m=1..199.
    apply( A285268_row(m)=vector(m,n,A285268(m,n)), [1..9]) \\ M. F. Hasler, Oct 10 2019
    
  • PARI
    T(n, k) = {exp(1)*(incgam(n+1, 1) - incgam(n-k, 1)*(n-k)*n!/(n-k)!) - 1;}
      apply(Trow(n) = vector(n, k, round(T(n, k))), [1..10]) \\ Adjust the realprecision if needed. Peter Luschny, Oct 10 2019

Formula

T(m, n) = Sum_{k=1..n} m!/(m-k)! = m*(1 + (m-1)*(1 + (m-2)*(1 + ... + m-n+1)...)), cf. PARI code. - M. F. Hasler, Oct 10 2019
T(n, k) = exp(1)*(Gamma(n+1, 1) - Gamma(n-k, 1)*(n-k)*n!/(n-k)!) - 1. - Peter Luschny, Oct 10 2019
Sum-free and Gamma-free formula: T(m, n) = b(m) - m!*b(m-n)/(m-n)! where b(0)=0, b(j)=floor(j!*e-1) for j>0. - Manfred Boergens, Jun 22 2022

A121682 Triangle read by rows: T(i,j) = (T(i-1,j) + i)*i.

Original entry on oeis.org

1, 6, 4, 27, 21, 9, 124, 100, 52, 16, 645, 525, 285, 105, 25, 3906, 3186, 1746, 666, 186, 36, 27391, 22351, 12271, 4711, 1351, 301, 49, 219192, 178872, 98232, 37752, 10872, 2472, 456, 64, 1972809, 1609929, 884169, 339849, 97929, 22329, 4185, 657, 81, 19728190, 16099390, 8841790, 3398590, 979390, 223390, 41950, 6670, 910, 100
Offset: 1

Views

Author

Thomas Wieder, Aug 15 2006

Keywords

Comments

The first column is A030297 = a(n) = n*(n+a(n-1)). The main diagonal are the squares A000290 = n^2. The first lower diagonal (6,21,52,...) is A069778 = q-factorial numbers 3!_q. See also A121662.

Examples

			Triangle begins:
      1
      6     4
     27    21     9
    124   100    52   16
    645   525   285  105  25
   3906  3186  1746  666  186  36
  27391 22351 12271 4711 1351 301 49
  ...
		

References

  • T. A. Gulliver, Sequences from Cubes of Integers, Int. Math. Journal, 4 (2003), 439-445.

Crossrefs

Row sums give A337001.

Programs

  • Maple
    T:= proc(i, j) option remember;
          `if`(j<1 or j>i, 0, (T(i-1, j)+i)*i)
        end:
    seq(seq(T(n, k), k=1..n), n=1..10);  # Alois P. Heinz, Jun 22 2022
  • Mathematica
    T[n_, k_] /; 1 <= k <= n := T[n, k] = (T[n-1, k]+n)*n;
    T[, ] = 0;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 17 2022 *)
  • Python
    def T(i, j): return (T(i-1, j)+i)*i if 1 <= j <= i else 0
    print([T(r, c) for r in range(1, 11) for c in range(1, r+1)]) # Michael S. Branicky, Jun 22 2022

Extensions

Edited by N. J. A. Sloane, Sep 15 2006
Formula in name corrected by Alois P. Heinz, Jun 22 2022

A224869 a(n) = n*( a(n-1)+1 ), initialized by a(1) = -1.

Original entry on oeis.org

-1, 0, 3, 16, 85, 516, 3619, 28960, 260649, 2606500, 28671511, 344058144, 4472755885, 62618582404, 939278736075, 15028459777216, 255483816212689, 4598708691828420, 87375465144739999, 1747509302894800000, 36697695360790800021, 807349297937397600484
Offset: 1

Views

Author

Alex Ratushnyak, Jul 22 2013

Keywords

Examples

			a(4) = 4*(a(3)+1) = 4*4 = 16.
		

Crossrefs

Cf. A007526, A038156, A166554, A121662 (3rd column).

Programs

Formula

a(n) +(-n-2)*a(n-1) +(2*n-1)*a(n-2) +(-n+2)*a(n-3)=0. - R. J. Mathar, Jul 28 2013
a(n) = exp(1)*n*Gamma(n,1) - 2*Gamma(n+1,0). - Martin Clever, Mar 27 2023

A347667 Triangle read by rows: T(n,k) = Sum_{j=0..k} binomial(n,j) * j! (0 <= k <= n).

Original entry on oeis.org

1, 1, 2, 1, 3, 5, 1, 4, 10, 16, 1, 5, 17, 41, 65, 1, 6, 26, 86, 206, 326, 1, 7, 37, 157, 517, 1237, 1957, 1, 8, 50, 260, 1100, 3620, 8660, 13700, 1, 9, 65, 401, 2081, 8801, 28961, 69281, 109601, 1, 10, 82, 586, 3610, 18730, 79210, 260650, 623530, 986410
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 10 2021

Keywords

Examples

			Triangle begins:
  1;
  1, 2;
  1, 3,  5;
  1, 4, 10,  16;
  1, 5, 17,  41,   65;
  1, 6, 26,  86,  206,  326;
  1, 7, 37, 157,  517, 1237, 1957;
  1, 8, 50, 260, 1100, 3620, 8660, 13700;
  ...
		

Crossrefs

T(n,n) = A000522, T(2*n,n) = A066211.

Programs

  • Mathematica
    T[n_, k_] := Sum[Binomial[n, j] j!, {j, 0, k}]; Table[T[n, k], {n, 0, 9}, {k, 0, n}] // Flatten
Showing 1-4 of 4 results.