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 23 results. Next

A246049 Number T(n,k) of endofunctions on [n] where the smallest cycle length equals k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 3, 1, 0, 19, 6, 2, 0, 175, 51, 24, 6, 0, 2101, 580, 300, 120, 24, 0, 31031, 8265, 4360, 2160, 720, 120, 0, 543607, 141246, 74130, 41160, 17640, 5040, 720, 0, 11012415, 2810437, 1456224, 861420, 430080, 161280, 40320, 5040
Offset: 0

Views

Author

Alois P. Heinz, Aug 11 2014

Keywords

Comments

T(0,0) = 1 by convention.
In general, number of endofunctions on [n] where the smallest cycle length equals k is asymptotic to (exp(-H(k-1)) - exp(-H(k))) * n^n, where H(k) is the harmonic number A001008/A002805, k>=1. - Vaclav Kotesovec, Aug 21 2014

Examples

			Triangle T(n,k) begins:
  1;
  0,      1;
  0,      3,      1;
  0,     19,      6,     2;
  0,    175,     51,    24,     6;
  0,   2101,    580,   300,   120,    24;
  0,  31031,   8265,  4360,  2160,   720,  120;
  0, 543607, 141246, 74130, 41160, 17640, 5040, 720;
  ...
		

Crossrefs

T(2n,n) gives A246050.
Row sums give A000312.
Main diagonal gives A000142(n-1) for n>0.

Programs

  • Maple
    with(combinat):
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i>n, 0,
          add((i-1)!^j*multinomial(n, n-i*j, i$j)/j!*
          b(n-i*j, i+1), j=0..n/i)))
        end:
    A:= (n, k)-> add(binomial(n-1, j-1)*n^(n-j)*b(j, k), j=0..n):
    T:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), A(n, k) -A(n, k+1)):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    multinomial[n_, k_List] := n!/Times @@ (k!);
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i>n, 0,
          Sum[(i-1)!^j*multinomial[n, {n-i*j, Sequence @@ Table[i, {j}]}]/j!*
          b[n-i*j, i+1], {j, 0, n/i}]]];
    A[n_, k_] := Sum[Binomial[n-1, j-1]*n^(n-j)*b[j, k], {j, 0, n}];
    T[n_, k_] := If[k == 0, If[n == 0, 1, 0], A[n, k] - A[n, k+1]];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jan 06 2015, after Alois P. Heinz *)

A055858 Coefficient triangle for certain polynomials.

Original entry on oeis.org

1, 1, 2, 4, 9, 6, 27, 64, 48, 36, 256, 625, 500, 400, 320, 3125, 7776, 6480, 5400, 4500, 3750, 46656, 117649, 100842, 86436, 74088, 63504, 54432, 823543, 2097152, 1835008, 1605632, 1404928, 1229312, 1075648, 941192, 16777216, 43046721
Offset: 0

Views

Author

Wolfdieter Lang, Jun 20 2000

Keywords

Comments

The coefficients of the partner polynomials are found in triangle A055864.

Examples

			{1}; {1,2}; {4,9,6}; {27,64,48,36}; ...
Fourth row polynomial (n=3): p(3,x) = 27 + 64*x + 48*x^2 + 36*x^3.
		

Crossrefs

Column sequences are A000312(n), n >= 1, A055860 (A000169), A055861 (A053506), A055862-3 for m=0..4, row sums: A045531(n+1)= |A039621(n+1, 2)|, n >= 0.

Programs

  • Mathematica
    a[n_, m_] /; n < m = 0; a[0, 0] = 1; a[n_, 0] := n^n; a[n_, m_] := n^(m-1)*(n+1)^(n-m+1); Table[a[n, m], {n, 0, 8}, {m, 0, n}] // Flatten (* Jean-François Alcover, Jun 20 2013 *)

Formula

a(n, m)=0 if n < m; a(0, 0)=1, a(n, 0) = n^n, n >= 1, a(n, m) = n^(m-1)*(n+1)^(n-m+1), n >= m >= 1;
E.g.f. for column m: A(m, x); A(0, x) = 1/(1+W(-x)); A(1, x) = -1 - (d/dx)W(-x) = -1-W(-x)/((1+W(-x))*x); A(2, x) = A(1, x)-int(A(1, x), x)/x-(1/x+x); recursion: A(m, x) = A(m-1, x)-int(A(m-1, x), x)/x-((m-1)^(m-1))*(x^(m-1))/(m-1)!, m >= 3; W(x) principal branch of Lambert's function.

A055869 a(n) = (n+1)^n - n^n.

Original entry on oeis.org

1, 5, 37, 369, 4651, 70993, 1273609, 26269505, 612579511, 15937424601, 457696700077, 14381984674225, 490839666661891, 18080919199832609, 715027614225987601, 30214447801957316865, 1358671297852359767791, 64780942222614703957417, 3264460344339686410876021
Offset: 1

Views

Author

Wolfdieter Lang, Jun 20 2000

Keywords

Comments

Number of functions f:[n]->[n+1] such that some x in [n] maps to n+1.
Number of switching generators for a power polyadic n-context ({1..k}, ..., {1..k}, <>) with n=k [Theorems 5 and 6, page 81, in Ignatov]. - Dmitry I. Ignatov, Nov 23 2022

Crossrefs

Row sums of triangle A055864.

Programs

Formula

E.g.f.: W(-x)*(x-1)/((1+W(-x))*x), W(x) principal branch of Lambert's function.
a(n) = Sum_{m=1..n} A055864(n, m).
a(n) = Sum_{i=0..n-1} n^i*C(n, i). - Olivier Gérard, Jun 26 2001
With interpolated zeros, ceiling(n/2)^floor(n/2) - floor(n/2)^floor(n/2). - Paul Barry, Jul 13 2005
a(n) = Sum_{k=1..n} (-1)^(n-k)*k!*Stirling2(n,k)*binomial(n+k-1,n). - Vladimir Kruchinin, Sep 20 2015

Extensions

More terms from Vincenzo Librandi, Jan 11 2015

A354794 Triangle read by rows. The Bell transform of the sequence {m^m | m >= 0}.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 4, 3, 1, 0, 27, 19, 6, 1, 0, 256, 175, 55, 10, 1, 0, 3125, 2101, 660, 125, 15, 1, 0, 46656, 31031, 9751, 1890, 245, 21, 1, 0, 823543, 543607, 170898, 33621, 4550, 434, 28, 1, 0, 16777216, 11012415, 3463615, 688506, 95781, 9702, 714, 36, 1
Offset: 0

Views

Author

Peter Luschny, Jun 09 2022

Keywords

Comments

For the definition of the Bell transform see A264428. The Bell transform of {(-m)^m | m >= 0} is A039621. The numbers A039621(n, k) are known as the Lehmer-Comtet numbers of 2nd kind. We think it is more natural to use Bell_{n, k}({m^m}) as the basis for the definition (and let the triangle start at (0, 0)).

Examples

			Triangle T(n, k) begins:
[0] 1;
[1] 0,        1;
[2] 0,        1,        1;
[3] 0,        4,        3,       1;
[4] 0,       27,       19,       6,      1;
[5] 0,      256,      175,      55,     10,     1;
[6] 0,     3125,     2101,     660,    125,    15,    1;
[7] 0,    46656,    31031,    9751,   1890,   245,   21,   1;
[8] 0,   823543,   543607,  170898,  33621,  4550,  434,  28,  1;
[9] 0, 16777216, 11012415, 3463615, 688506, 95781, 9702, 714, 36, 1;
		

References

  • Louis Comtet, Advanced Combinatorics. Reidel, Dordrecht, 1974, p. 139-140.

Crossrefs

Cf. A264428, A039621 (signed variant), A195979 (row sums), A000312 (column 1), A045531 (column 2), A281596 (column 3), A281595 (column 4), A000217 (diagonal 1), A215862 (diagonal 2), A354795 (matrix inverse), A137452 (Abel).

Programs

  • Maple
    T := (n, k) -> if n = k then 1 else
    add((-1)^j*(n-j-1)^(n-1)/(j!*(k-1-j)!), j = 0.. k-1) fi:
    seq(seq(T(n, k), k = 0..n), n = 0..9);
    # Alternatively, using the function BellMatrix from A264428:
    BellMatrix(n -> n^n, 9);
    # Or by recursion:
    R := proc(n, k, m) option remember;
       if k < 0 or n < 0 then 0 elif k = 0 then 1 else
       m*R(n, k-1, m) + R(n-1, k, m+1) fi end:
    A039621 := (n, k) -> ifelse(n = 0, 1, R(k-1, n-k, n-k)):
  • Mathematica
    Unprotect[Power]; Power[0, 0] = 1; pow[n_] := n^n;
    R = Range[0, 9]; T[n_, k_] := BellY[n, k, pow[R]];
    Table[T[n, k], {n, R}, {k, 0, n}] // Flatten
  • Python
    from functools import cache
    @cache
    def t(n, k, m):
        if k < 0 or n < 0: return 0
        if k == 0: return n ** k
        return m * t(n, k - 1, m) + t(n - 1, k, m + 1)
    def A354794(n, k): return t(k - 1, n - k, n - k) if n != k else 1
    for n in range(9): print([A354794(n, k) for k in range(n + 1)])

Formula

T(n, k) = Bell_{n, k}(A000312), where Bell_{n, k} is the partial Bell polynomial evaluated over the powers m^m (with 0^0 = 1). See the Mathematica program.
T(n, k) = Sum_{j=0..k-1} (-1)^j*(n-j-1)^(n - 1)/(j! * (k-1-j)!) for 0 <= k < n and T(n, n) = 1.
T(n, k) = r(k-1, n-k, n-k) for n,k >= 1 and T(0, 0) = 1, where r(n, k, m) = m*r(n, k-1, m) + r(n-1, k, m+1) and r(n, 0, m) = 1. (see Vladimir Kruchinin's formula in A039621).
Sum_{k=1..n} binomial(k + x - 1, k-1)*(k-1)!*T(n, k) = (n + x)^(n - 1) for n >= 1.
Sum_{k=1..n} (-1)^(k+j)*Stirling1(k, j)*T(n, k) = n^(n-j)*binomial(n-1, j-1) for n >= 1, which are, up to sign, the coefficients of the Abel polynomials (A137452).
From Werner Schulte, Jun 14 2022 and Jun 19 2022: (Start)
E.g.f. of column k >= 0: (Sum_{i>0} (i-1)^(i-1) * t^i / i!)^k / k!.
Conjecture: T(n, k) = Sum_{i=0..n-k} A048994(n-k, i) * A048993(n+i-1, n-1) for 0 < k <= n and T(n, 0) = 0^n for n >= 0; proved by Mike Earnest, see link at A354797. (End)

A066274 Number of endofunctions of [n] such that 1 is not a fixed point.

Original entry on oeis.org

0, 2, 18, 192, 2500, 38880, 705894, 14680064, 344373768, 9000000000, 259374246010, 8173092077568, 279577021469772, 10318292052303872, 408700964355468750, 17293822569102704640, 778579070010669895696, 37160496515557841043456, 1874292305362402347591138
Offset: 1

Views

Author

Len Smiley, Dec 09 2001

Keywords

Comments

a(n) is the number of functional digraphs that are not a solitary rooted tree. - Geoffrey Critzer, Aug 31 2013
For n > 1 a(n) is the number of numbers with n digits in base n. - Gionata Neri, Feb 18 2016
a(n) is the number of pairs of adjacent equal letters in all n-ary words of length n. - John Tyler Rascoe, Nov 19 2024

Examples

			a(2)=2: [1->2,2->1], [1->2,2->2].
		

Crossrefs

Programs

Formula

a(n) = n^n - n^(n-1).
E.g.f.: T^2/(1-T), where T=T(x) is Euler's tree function (see A000169).
For n > 1 a(n)=1/(Integral_{x=n..infinity} 1/x^n dx). - Francesco Daddi, Aug 01 2011
a(n) = sum(i=1..n-1, C(n,i)*(i^i*(n-i)^(n-i-1))). - Vladimir Kruchinin May 15 2013
E.g.f.: x^2*A''(x) where A(x) is the e.g.f. for A000272. - Geoffrey Critzer, Aug 31 2013
a(n) = 2*A081131(n) = 2*|A070896(n)|. - Geoffrey Critzer, Aug 31 2013

A199656 Triangular array read by rows, T(n,k) is the number of functions from {1,2,...,n} into {1,2,...,n} with maximum value of k.

Original entry on oeis.org

1, 1, 3, 1, 7, 19, 1, 15, 65, 175, 1, 31, 211, 781, 2101, 1, 63, 665, 3367, 11529, 31031, 1, 127, 2059, 14197, 61741, 201811, 543607, 1, 255, 6305, 58975, 325089, 1288991, 4085185, 11012415, 1, 511, 19171, 242461, 1690981, 8124571, 30275911, 93864121, 253202761
Offset: 1

Views

Author

Geoffrey Critzer, Nov 08 2011

Keywords

Comments

Row sums = A000312.
Main diagonal = A045531.

Examples

			Triangle begins:
  1
  1    3
  1    7   19
  1   15   65   175
  1   31  211   781   2101
  1   63  665  3367  11529   31031
  1  127 2059 14197  61741  201811  543607
  ...
		

Crossrefs

Programs

  • Magma
    /* As triangle: */ [[k^n - (k-1)^n: k in [1..n]]: n in [1..9]]; // Vincenzo Librandi, Jan 28 2013
  • Mathematica
    Table[Table[(1-((i-1)/i)^n) i^n,{i,1,n}],{n,1,8}]//Grid
    Flatten[Table[k^n - (k-1)^n, {n, 0, 10}, {k, 1, n}]] (* Vincenzo Librandi, Jan 28 2013 *)

Formula

T(n,k) = k^n-(k-1)^n.

A039621 Triangle of Lehmer-Comtet numbers of 2nd kind.

Original entry on oeis.org

1, -1, 1, 4, -3, 1, -27, 19, -6, 1, 256, -175, 55, -10, 1, -3125, 2101, -660, 125, -15, 1, 46656, -31031, 9751, -1890, 245, -21, 1, -823543, 543607, -170898, 33621, -4550, 434, -28, 1, 16777216, -11012415, 3463615, -688506, 95781, -9702, 714, -36, 1
Offset: 1

Views

Author

Keywords

Comments

Also the Bell transform of (-n)^n adding 1,0,0,0,... as column 0. For the definition of the Bell transform see A264428. - Peter Luschny, Jan 16 2016

Examples

			The triangle T(n, k) begins:
[1]       1;
[2]      -1,      1;
[3]       4,     -3,       1;
[4]     -27,     19,      -6,     1;
[5]     256,   -175,      55,   -10,     1;
[6]   -3125,   2101,    -660,   125,   -15,   1;
[7]   46656, -31031,    9751, -1890,   245, -21,   1;
[8] -823543, 543607, -170898, 33621, -4550, 434, -28, 1;
		

Crossrefs

A008296 (matrix inverse), A354794 (variant), A045531 (column |a(n, 2)|).
Cf. A185164.

Programs

  • Maple
    R := proc(n, k, m) option remember;
       if k < 0  or n < 0 then 0 elif k = 0 then 1 else
       m*R(n, k-1, m) + R(n-1, k, m+1) fi end:
    A039621 := (n, k) -> (-1)^(n-k)*R(k-1, n-k, n-k):
    seq(seq(A039621(n, k), k = 1..n), n = 1..9); # Peter Luschny, Jun 10 2022 after Vladimir Kruchinin
  • Mathematica
    a[1, 1] = 1; a[n_, k_] := 1/(k-1)! Sum[((-1)^(n-k-i)*Binomial[k-1, i]*(n-i-1)^(n-1)), {i, 0, k-1}];
    Table[a[n, k], {n, 1, 10}, {k, 1, n}]//Flatten (* Jean-François Alcover, Jun 03 2019 *)
  • Maxima
    T(n,k,m):=if k<0 or n<0 then 0 else if k=0 then 1 else m*T(n,k-1,m)+T(n-1,k,m+1);
    a(n,k):=if nVladimir Kruchinin, Mar 07 2020
  • PARI
    tabl(nn) = {for (n = 1, nn, for (k = 1, n, print1(sum(i = 0, k-1,(-1)^(n-k-i)*binomial(k-1, i)*(n-i-1)^(n-1))/(k-1)!, ", ");); print(););} \\ Michel Marcus, Aug 28 2013
    
  • Sage
    # uses[bell_matrix from A264428]
    # Adds 1,0,0,0,... as column 0 at the left side of the triangle.
    bell_matrix(lambda n: (-n)^n, 7) # Peter Luschny, Jan 16 2016
    

Formula

(k-1)!*a(n, k) = Sum_{i=0..k-1}((-1)^(n-k-i)*binomial(k-1, i)*(n-i-1)^(n-1)).
a(n,k) = (-1)^(n-k)*T(k,n-k,n-k), n>=k, where T(n,k,m)=m*T(n,m-1,k)+T(n-1,k,m+1), T(n,0,m)=1. - Vladimir Kruchinin, Mar 07 2020

A281596 a(n) = ((n-2)^n - 2*(n-1)^n + n^n)/2.

Original entry on oeis.org

0, 0, 1, 6, 55, 660, 9751, 170898, 3463615, 79669320, 2050086511, 58346365110, 1819621847407, 61705703989020, 2260586259354151, 88971796139662842, 3743940350046570751, 167735288431662235920, 7971302827015366403551, 400510700317394780627934, 21212944650652080893863087
Offset: 0

Views

Author

Peter Luschny, Jan 26 2017

Keywords

Crossrefs

Programs

  • Maple
    a := n -> ((n-2)^n-2*(n-1)^n+n^n)/2:
    seq(a(n), n=0..21);
  • Mathematica
    A281596[n_] := If[n == 0, 0, ((n-2)^n - 2*(n-1)^n + n^n)/2];
    Array[A281596, 25, 0] (* Paolo Xausa, Jul 10 2024 *)

Formula

a(n) ~ n^n*(1/2+(1/2-1/n)*e^(-2)+(1/(2*n)-1)*e^(-1)).

A060226 a(n) = n^n - n*(n-1)^(n-1).

Original entry on oeis.org

1, 0, 2, 15, 148, 1845, 27906, 496951, 10188872, 236425545, 6125795110, 175311670611, 5492360400924, 186965800764925, 6871755333266474, 271213787997489135, 11440441827615801616, 513645612633274386705
Offset: 0

Views

Author

Henry Bottomley, Jul 12 2001

Keywords

Comments

For n > 0, a(n) = number of endofunctions of [n] mapping some x<>1 to 1. - Len Smiley, Nov 15 2001 (Endofunction interpretation from a(n) = n*(n^(n-1) - (n-1)^(n-1)).)

Crossrefs

Programs

  • Haskell
    a060226 0 = 1
    a060226 n = a000312 n - n * a000312 (n - 1)
    -- Reinhard Zumkeller, Aug 27 2012
    
  • Magma
    A060226:= func< n | n^n - n*(n-1)^(n-1) >;
    [A060226(n): n in [0..30]]; // G. C. Greubel, Nov 03 2024
    
  • Maple
    f := n-> n*sum(binomial(n-1,j-1)*(n-1)^(n-j), j=2..n);
    g := n-> n^n -n*(n-1)^(n-1);
    h := n-> sum(binomial(n,j)*j^(j-1)*(n-j)^(n-j), j=2..n);
    k := n-> sum(binomial(n,j-1)*(j-1)^(j-1)*(n-j)^(n-j), j=2..n); # then a(n)=f(n)=g(n)=h(n)=k(n)
  • Mathematica
    Join[{1,0},Table[n^n-n*(n-1)^(n-1),{n,2,20}]] (* Harvey P. Dale, Nov 16 2012 *)
  • PARI
    { for (n=0, 100, write("b060226.txt", n, " ", n^n - n*(n - 1)^(n - 1)); ) } \\ Harry J. Smith, Jul 03 2009
    
  • SageMath
    def A060226(n): return n^n - n*(n-1)^(n-1)
    [A060226(n) for n in range(31)] # G. C. Greubel, Nov 03 2024

Formula

a(n) = n*A055869(n-1).
Limit_{n -> oo} ( a(n)/a(n-1) - a(n-1)/a(n-2) ) -> e.
E.g.f.: (1-x)/(1-T), where T=T(x) is Euler's tree function (see A000169). The e.g.f. for n > 0 terms only (applicable to endofunctions) is (T - x)/(1 - T). - Len Smiley, Dec 10 2001

A350134 Number of endofunctions on [n] with at least one isolated fixed point.

Original entry on oeis.org

0, 1, 1, 10, 87, 1046, 15395, 269060, 5440463, 124902874, 3208994379, 91208536112, 2841279322871, 96258245162678, 3523457725743059, 138573785311560916, 5827414570508386335, 260928229315498155314, 12393729720071855683739, 622422708333615857463608
Offset: 0

Views

Author

Alois P. Heinz, Dec 15 2021

Keywords

Examples

			a(3) = 10: 123, 122, 133, 132, 121, 323, 321, 113, 223, 213.
		

Crossrefs

Programs

  • Maple
    g:= proc(n) option remember; add(n^(n-j)*(n-1)!/(n-j)!, j=1..n) end:
    b:= proc(n, t) option remember; `if`(n=0, t, add(g(i)*
          b(n-i, `if`(i=1, 1, t))*binomial(n-1, i-1), i=1..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..23);
  • Mathematica
    g[n_] := g[n] = Sum[n^(n - j)*(n - 1)!/(n - j)!, {j, 1, n}];
    b[n_, t_] := b[n, t] = If[n == 0, t, Sum[g[i]*
         b[n - i, If[i == 1, 1, t]]*Binomial[n - 1, i - 1], {i, 1, n}]];
    a[n_] := b[n, 0];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Apr 27 2022, after Alois P. Heinz *)

Formula

a(n) = A000312(n) - abs(A069856(n)).
a(n) = Sum_{k=1..n} A350212(n,k).
Showing 1-10 of 23 results. Next