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

A344113 a(n) = 2^(n^2) - n^n.

Original entry on oeis.org

1, 12, 485, 65280, 33551307, 68719430080, 562949952597769, 18446744073692774400, 2417851639229257961991863, 1267650600228229401486703205376, 2658455991569831745807613835249018541, 22300745198530623141535718272639445405532160
Offset: 1

Views

Author

Mohammad K. Azarian, May 14 2021

Keywords

Comments

a(n) is the number of relations on a set with n elements that are not functions.

Examples

			a(1) = 2^(1^2) - 1^1 = 1.
a(2) = 2^(2^2) - 2^2 = 12.
a(3) = 2^(3^2) - 3^3 = 485.
		

Crossrefs

Programs

  • Mathematica
    Table[2^(n^2) - n^n, {n, 12}] // Flatten

A344115 Triangle read by rows: T(n,k) is the number of relations from an n-element set to a k-element set that are not one-to-one functions.

Original entry on oeis.org

1, 2, 14, 5, 58, 506, 12, 244, 4072, 65512, 27, 1004, 32708, 1048456, 33554312, 58, 4066, 262024, 16776856, 1073741104, 68719476016, 121, 16342, 2096942, 268434616, 34359735848, 4398046506064, 562949953416272, 248, 65480, 16776880, 4294965616, 1099511621056
Offset: 1

Views

Author

Mohammad K. Azarian, Jun 06 2021

Keywords

Comments

If n=k, then T(n,k) = 2^(n^2) - n!, which is A344114, and if kA344110.

Examples

			For T(2,2): the number of relations is 2^4 and the number of one-to-one functions is 2, so 2^4 - 2 = 14 and thus T(2,2) = 14.
Triangle T(n,k) begins:
   1;
   2,   14;
   5,   58,   506;
  12,  244,  4072,   65512;
  27, 1004, 32708, 1048456, 33554312;
		

Crossrefs

Programs

  • Mathematica
    Table[2^(n*k) - k!/(k - n)!, {k, 10}, {n, k}] // Flatten

Formula

T(n,k) = 2^(n*k) - k!/(k-n)!, k >= n.

A347034 Triangle read by columns: T(n,k) is the number of functions from an n-element set to a k-element set that are not one-to-one, k>=n>=1.

Original entry on oeis.org

0, 0, 2, 0, 3, 21, 0, 4, 40, 232, 0, 5, 65, 505, 3005, 0, 6, 96, 936, 7056, 45936, 0, 7, 133, 1561, 14287, 112609, 818503, 0, 8, 176, 2416, 26048, 241984, 2056832, 16736896, 0, 9, 225, 3537, 43929, 470961, 4601529, 42683841, 387057609, 0, 10, 280, 4960, 69760, 848800
Offset: 1

Views

Author

Mohammad K. Azarian, Aug 28 2021

Keywords

Comments

The formula for this sequence is Theorem 2.2(iv) of the author's paper, p. 131 (see the link).

Examples

			For T(2,3): the number of functions is 3^2 and the number of one-to-one functions is 6, so 3^2 - 6 = 3 and thus T(2,3) = 3.
Triangle T(n,k) begins:
       k=1  k=2   k=3   k=4    k=5     k=6
  n=1:  0    0    0     0      0       0
  n=2:       2    3     4      5       6
  n=3:            21    40     65      96
  n=4:                  232    505     936
  n=5:                         3005    7056
  n=6:                                 45936
		

Crossrefs

Programs

  • Maple
    A347034 := proc(n,k)
        k^n-k!/(k-n)! ;
    end proc:
    seq(seq(A347034(n,k),n=1..k),k=1..12) ; # R. J. Mathar, Jan 12 2023
  • Mathematica
    Table[k^n - k!/(k - n)!, {k, 12}, {n, k}] // Flatten
  • PARI
    T(n,k) = k^n - k!/(k - n)!;
    row(k) = vector(k, i, T(i, k)); \\ Michel Marcus, Oct 01 2021

Formula

T(n,k) = k^n - k!/(k - n)!, k>=n.
T(n,n) = A036679(n).
Showing 1-3 of 3 results.