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

A052182 Determinant of n X n matrix whose rows are cyclic permutations of 1..n.

Original entry on oeis.org

1, -3, 18, -160, 1875, -27216, 470596, -9437184, 215233605, -5500000000, 155624547606, -4829554409472, 163086595857367, -5952860799406080, 233543408203125000, -9799832789158199296, 437950726881001816329, -20766159817517617053696, 1041273502979112415328410
Offset: 1

Views

Author

Henry M. Gunn High School Mathematical Circle (Joshua Zucker), Jan 26 2000

Keywords

Comments

Each row is a cyclic shift to the right by one place of the previous row. See the example below. - N. J. A. Sloane, Jan 07 2019
|a(n)| = number of labeled mappings from n points to themselves (endofunctions) with an odd number of cycles. - Vladeta Jovovic, Mar 30 2006
|a(n)| = number of functions from {1,2,...,n}->{1,2,...,n} such that of all recurrent elements the least is always mapped to the greatest. - Geoffrey Critzer, Aug 29 2013

Examples

			a(3) = 18 because this is the determinant of [(1,2,3), (3,1,2), (2,3,1) ].
		

Crossrefs

Programs

  • Maple
    1,seq(LinearAlgebra:-Determinant(Matrix(n,shape=Circulant[$1..n])),n=2..30); # Robert Israel, Aug 31 2014
  • Mathematica
    f[n_] := Det[ Table[ RotateLeft[ Range@ n, -j], {j, 0, n - 1}]]; Array[f, 19] (* or *)
    f[n_] := (-1)^(n - 1)*n^(n - 2)*(n^2 + n)/2; Array[f, 19]
    (* Robert G. Wilson v, Aug 31 2014 *)
    Table[Det[Table[RotateRight[Range[k],n],{n,0,k-1}]],{k,30}] (* Harvey P. Dale, Jun 20 2024 *)
  • MuPAD
    (1+n)^(n-1)*binomial(n+2,n)*(-1)^(n) $ n=0..16 // Zerinvary Lajos, Apr 01 2007
    
  • PARI
    a(n) = (n+1)*(-n)^(n-1)/2; \\ Altug Alkan, Dec 17 2017

Formula

a(n) = (-1)^(n-1) * n^(n-2) * (n^2 + n)/2.
E.g.f.[A052182] = E.g.f.[A000312] * E.g.f.[A000272], so A052182(unsigned) is "tree-like". E.g.f.: (T-T^2/2)/(1-T), where T=T(x) is Euler's tree function (see A000169). E.g.f. for signed sequence: (W+W^2/2)/(1+W), where W=W(x)=-T(-x) is the Lambert W function. - Len Smiley, Dec 13 2001
Conjecture: a(n) = -Res( f(n), x^n - 1), where Res is the resultant and f(n) = Sum_{k=1..n} k*x^k. - Benedict W. J. Irwin, Dec 07 2016

Extensions

More terms from James Sellers, Jan 31 2000

A134095 Expansion of e.g.f. A(x) = 1/(1 - LambertW(-x)^2).

Original entry on oeis.org

1, 0, 2, 12, 120, 1480, 22320, 396564, 8118656, 188185680, 4871980800, 139342178140, 4363291266048, 148470651659928, 5455056815237120, 215238256785814500, 9077047768435752960, 407449611073696325536, 19396232794530856894464, 976025303642559490903980
Offset: 0

Views

Author

Paul D. Hanna, Oct 11 2007

Keywords

Comments

E.g.f. equals the square of the e.g.f. of A060435, where A060435(n) = number of functions f: {1,2,...,n} -> {1,2,...,n} with even cycles only.

Examples

			E.g.f.: A(x) = 1 + 0*x + 2*x^2/2! + 12*x^3/3! + 120*x^4/4! + 1480*x^5/5! + ...
The formula A(x) = 1/(1 - LambertW(-x)^2) is illustrated by:
A(x) = 1/(1 - (x + x^2 + 3^2*x^3/3! + 4^3*x^4/4! + 5^4*x^5/5! + ...)^2).
		

Crossrefs

Cf. A060435; indirectly related: A062817, A132608.

Programs

  • Maple
    seq(simplify(GAMMA(n+1,-n)*(-exp(-1))^n),n=0..20); # Vladeta Jovovic, Oct 17 2007
  • Mathematica
    CoefficientList[Series[1/(1-LambertW[-x]^2), {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Nov 27 2012 *)
    a[x0_] := x D[1/x Exp[x], {x, n}] x^n Exp[-x] /. x->x0
    Table[a[n], {n, 0, 20}] (* Gerry Martens, May 05 2016 *)
  • PARI
    {a(n)=sum(k=0,n,(n-k)^k*k^(n-k)*binomial(n,k))}
    
  • PARI
    /* Generated by e.g.f. 1/(1 - LambertW(-x)^2 ): */
    {a(n)=my(LambertW=-x*sum(k=0,n,(-x)^k*(k+1)^(k-1)/k!) +x*O(x^n)); n!*polcoeff(1/(1-subst(LambertW,x,-x)^2),n)}

Formula

a(n) = Sum_{k=0..n} C(n,k) * (n-k)^k * k^(n-k).
a(n) = n!*Sum_{k=0..n} (-1)^(n-k)*n^k/k!. - Vladeta Jovovic, Oct 17 2007
a(n) ~ n^n/2. - Vaclav Kotesovec, Nov 27 2012, simplified Nov 22 2021
a(n) = n! * [x^n] exp(n*x)/(1 + x). - Ilya Gutkovskiy, Sep 18 2018
a(n) = (-1)^n*exp(-n)*Integral_{x=-n..oo} x^n*exp(-x) dx. - Thomas Scheuerle, Jan 29 2024

A246609 Number T(n,k) of endofunctions on [n] whose cycle lengths are multiples of k; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 4, 1, 0, 27, 6, 2, 0, 256, 57, 24, 6, 0, 3125, 680, 300, 120, 24, 0, 46656, 9945, 4480, 2160, 720, 120, 0, 823543, 172032, 78750, 41160, 17640, 5040, 720, 0, 16777216, 3438673, 1591296, 866460, 430080, 161280, 40320, 5040
Offset: 0

Views

Author

Alois P. Heinz, Aug 31 2014

Keywords

Comments

T(n,k) is defined for n,k >= 0. The triangle contains only the terms with k <= n. T(0,k) = 1, T(n,k) = 0 for k > n and n > 0.
Column k > 1 is asymptotic to n^(n - 1/2 + 1/(2*k)) * sqrt(2*Pi) / (2^(1/(2*k)) * k^(1/k) * Gamma(1/(2*k))) * (1 - (3*k-1)*(k-1) * sqrt(2/n) * Gamma(1/(2*k)) / (12 * k^2 * Gamma(1/2+1/(2*k)))). - Vaclav Kotesovec, Sep 01 2014

Examples

			Triangle T(n,k) begins:
  1;
  0,      1;
  0,      4,      1;
  0,     27,      6,     2;
  0,    256,     57,    24,     6;
  0,   3125,    680,   300,   120,    24;
  0,  46656,   9945,  4480,  2160,   720,  120;
  0, 823543, 172032, 78750, 41160, 17640, 5040, 720;
  ...
		

Crossrefs

Main diagonal gives A000142(n-1) for n > 0.
T(2n,n) gives A246618.

Programs

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

Formula

E.g.f. for column k > 0: 1 / (1 - (-1)^k * LambertW(-x)^k)^(1/k). - Vaclav Kotesovec, Sep 01 2014

A070896 Determinant of the Cayley addition table of Z_{n}.

Original entry on oeis.org

0, -1, -9, 96, 1250, -19440, -352947, 7340032, 172186884, -4500000000, -129687123005, 4086546038784, 139788510734886, -5159146026151936, -204350482177734375, 8646911284551352320, 389289535005334947848, -18580248257778920521728
Offset: 1

Views

Author

Santi Spadaro, May 23 2002

Keywords

Comments

a(n) is the determinant of the n X n matrix M_(i,j) = ((i+j) mod n) where i and j range from 0 to n-1. - Benoit Cloitre, Nov 29 2002
|a(n)| = number of labeled mappings from n points to themselves (endofunctions) with an even number of cycles. E.g.f.: (1/2)*LambertW(-x)^2/(1+LambertW(-x)). - Vladeta Jovovic, Mar 30 2006

Examples

			a(3) = -9 because the determinant of {{0,1,2}, {1,2,0}, {2,0,1}} is -9.
		

Crossrefs

Programs

  • Magma
    [(-1)^Floor(n/2)*(1/2)*(n-1)*n^(n-1): n in [1..50]]; // G. C. Greubel, Nov 14 2017
  • Mathematica
    Table[(-1)^Floor[n/2]*(1/2)*(n - 1)*n^(n - 1), {n, 1, 50}] (* G. C. Greubel, Nov 14 2017 *)
  • PARI
    a(n)=(-1)^floor(n/2)*(1/2)*(n-1)*n^(n-1)
    

Formula

a(n) = (-1)^floor(n/2)*(1/2)*(n-1)*n^(n-1). - Benoit Cloitre, Nov 29 2002

A116956 Number of functions f:{1,2,...,n}->{1,2,...,n} with odd cycles only.

Original entry on oeis.org

1, 1, 3, 18, 157, 1800, 25551, 432376, 8494809, 190029888, 4768313275, 132626098176, 4049755214517, 134677876657792, 4845193429684167, 187490897290080000, 7765153170076158001, 342721890859339812864, 16058392049508837366771, 796093438190851834236928
Offset: 0

Views

Author

Vladeta Jovovic, Mar 30 2006

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, add(`if`(j::odd,
           (j-1)!*b(n-j)*binomial(n-1, j-1), 0), j=1..n))
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, May 20 2016
  • Mathematica
    t = Sum[n^(n - 1) x^n/n!, {n, 1, 20}]; Range[0, 20]! CoefficientList[
    Series[((1 + t)/(1 - t))^(1/2), {x, 0, 20}], x]  (* Geoffrey Critzer, Dec 07 2011 *)

Formula

E.g.f.: sqrt((1-LambertW(-x))/(1+LambertW(-x))).
Sum_{k=0..n} binomial(n,k)*a(k)*a(n-k) = 2*n^n, n>0. - Vladeta Jovovic, Oct 11 2007
a(n) ~ n! * 2^(3/4)*Gamma(3/4)*exp(n)/(2*Pi*n^(3/4)). - Vaclav Kotesovec, Sep 24 2013

A273994 Number of endofunctions on [n] whose cycle lengths are Fibonacci numbers.

Original entry on oeis.org

1, 1, 4, 27, 250, 2975, 43296, 744913, 14797036, 333393345, 8403026320, 234300271811, 7161316358616, 238108166195263, 8556626831402560, 330494399041444425, 13654219915946513296, 600870384794864432897, 28060233470995898505024, 1386000542545570348128235
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, f, g;
          if n=0 then 1 else r, f, g:= $0..2;
          while f<=n do r:= r+(f-1)!*b(n-f)*
             binomial(n-1, f-1); f, g:= g, f+g
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, f, g}, If[n == 0, 1, {r, f, g} = {0, 1, 2}; While[f <= n, r = r + (f - 1)!*b[n - f]*Binomial[n - 1, f - 1]; {f, g} = {g, f + g}]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

A273996 Number of endofunctions on [n] whose cycle lengths are factorials.

Original entry on oeis.org

1, 1, 4, 25, 218, 2451, 33952, 560407, 10750140, 235118665, 5775676496, 157448312649, 4716609543736, 154007821275595, 5443783515005760, 207093963680817511, 8436365861409555728, 366403740283162634193, 16900793597898691865920, 825115046704241167668025
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, f, g;
          if n=0 then 1 else r, f, g:= $0..2;
          while f<=n do r:= r+(f-1)!*b(n-f)*
             binomial(n-1, f-1); f, g:= f*g, g+1
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, f, g}, If[n == 0, 1, {r, f, g} = {0, 1, 2}; While[f <= n, r = r + (f - 1)!*b[n - f]*Binomial[n - 1, f - 1]; {f, g} = {f*g, g + 1}]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

A273998 Number of endofunctions on [n] whose cycle lengths are primes.

Original entry on oeis.org

1, 0, 1, 8, 75, 904, 13255, 229536, 4587961, 103971680, 2634212961, 73787255200, 2264440519891, 75563445303072, 2724356214102055, 105546202276277504, 4373078169296869425, 192970687573630633216, 9035613818754820178689, 447469496697658409400960
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, p;
          if n=0 then 1 else r, p:=0, 2;
          while p<=n do r:= r+(p-1)!*b(n-p)*
             binomial(n-1, p-1); p:= nextprime(p)
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, p}, If[n == 0, 1, {r, p} = {0, 2}; While[p <= n, r = r + (p - 1)!*b[n - p]*Binomial[n-1, p-1]; p = NextPrime[p]]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

A305824 Number of endofunctions on [n] whose cycle lengths are triangular numbers.

Original entry on oeis.org

1, 1, 3, 18, 157, 1776, 24807, 413344, 8004537, 176630400, 4374300331, 120136735104, 3623854678677, 119102912981248, 4236492477409935, 162152320065532416, 6645233337842716273, 290321208589666369536, 13469914225467040015827, 661442143465113960448000
Offset: 0

Views

Author

Alois P. Heinz, Jun 10 2018

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, f, g;
          if n=0 then 1 else r, f, g:=$0..2;
          while f<=n do r, f, g:= r+(f-1)!*
             b(n-f)*binomial(n-1, f-1), f+g, g+1
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, f, g}, If[n == 0, 1, {r, f, g} = {0, 1, 2}; While[f <= n, {r, f, g} = {r + (f - 1)!*b[n - f]*Binomial[n - 1, f - 1], f + g, g + 1}]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 15 2018, after Alois P. Heinz *)

A273997 Number of endofunctions on [n] whose cycle lengths are squares.

Original entry on oeis.org

1, 1, 3, 16, 131, 1446, 19957, 329344, 6315129, 137942380, 3382214291, 92014156224, 2751300514987, 89701699067176, 3167429783609925, 120428877629249536, 4905431165356442993, 213120603686615692176, 9837426739843075654819, 480775495859934668704000
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, f, g;
          if n=0 then 1 else r, f, g:=0, 1, 3;
          while f<=n do r:= r+(f-1)!*b(n-f)*
             binomial(n-1, f-1); f, g:= f+g, g+2
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, f, g}, If[n == 0, 1, {r, f, g} = {0, 1, 3}; While[f <= n, r = r + (f - 1)!*b[n - f]*Binomial[n - 1, f - 1]; {f, g} = {f + g, g + 2}]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 06 2018, from Maple *)
Showing 1-10 of 11 results. Next