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

A003149 a(n) = Sum_{k=0..n} k!*(n - k)!.

Original entry on oeis.org

1, 2, 5, 16, 64, 312, 1812, 12288, 95616, 840960, 8254080, 89441280, 1060369920, 13649610240, 189550368000, 2824077312000, 44927447040000, 760034451456000, 13622700994560000, 257872110354432000, 5140559166898176000, 107637093007589376000, 2361827297364885504000
Offset: 0

Views

Author

Keywords

Comments

From Michael Somos, Feb 14 2002: (Start)
The sequence is the resistance between opposite corners of an (n+1)-dimensional hypercube of unit resistors, multiplied by (n+1)!.
The resistances for n+1 = 1,2,3,... are 1, 1, 5/6, 2/3, 8/15, 13/30, 151/420, 32/105, 83/315, 73/315, 1433/6930, ... (see A046878/A046879). (End)
Number of {12,21*,2*1}-avoiding signed permutations in the hyperoctahedral group.
a(n) is the sum of the reciprocals of the binomial coefficients C(n,k), multiplied by n!; example: a(4) = 4!*(1/1 + 1/4 + 1/6 + 1/4 + 1/1) = 64. - Philippe Deléham, May 12 2005
a(n) is the number of permutations on [n+1] that avoid the pattern 13-2|. The absence of a dash between 1 and 3 means the "1" and "3" must be consecutive in the permutation; the vertical bar means the "2" must occur at the end of the permutation. For example, 24153 fails to avoid this pattern: 243 is an offending subpermutation. - David Callan, Nov 02 2005
n!/a(n) is the probability that a random walk on an (n+1)-dimensional hypercube will visit the diagonally opposite vertex before it returns to its starting point. 2^n*a(n)/n! is the expected length of a random walk from one vertex of an (n+1)-dimensional hypercube to the diagonally opposite vertex (a walk which may include one or more passes through the starting point). These "random walk" examples are solutions to IBM's "Ponder This" puzzle for April, 2006. - Graeme McRae, Apr 02 2006
a(n) is the number of strong fixed points in all permutations of {1,2,...,n+1} (a permutation p of {1,2,...,n} is said to have j as a strong fixed point (splitter) if p(k)j for k>j). Example: a(2)=5 because the permutations of {1,2,3}, with marked strong fixed points, are: 1'2'3', 1'32, 312, 213', 231 and 321. - Emeric Deutsch, Oct 28 2008
Coefficients in the asymptotic expansion of exp(-2*x)*Ei(x)^2 for x -> inf, where Ei(x) is the exponential integral. - Vladimir Reshetnikov, Apr 24 2016

References

  • I. P. Goulden and D. M. Jackson, Combinatorial Enumeration, Wiley, N.Y., 1983, (1.1.11 b, p.342).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Volume 1 (1986), p. 49. [From Emeric Deutsch, Oct 28 2008]

Crossrefs

Cf. A052186, A006932, A145878. - Emeric Deutsch, Oct 28 2008
Cf. A324495, A324496, A324497 (problem similar to the random walks on the hypercube).

Programs

  • GAP
    F:=Factorial;; List([0..20], n-> Sum([0..n], k-> F(k)*F(n-k)) ); # G. C. Greubel, Dec 29 2019
    
  • Magma
    F:=Factorial; [ (&+[F(k)*F(n-k): k in [0..n]]): n in [0..20]]; // G. C. Greubel, Dec 29 2019
    
  • Maple
    seq( add(k!*(n-k)!, k=0..n), n=0..20); # G. C. Greubel, Dec 29 2019
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n+1,
          ((3*n+1)*a(n-1)-n^2*a(n-2))/2)
        end:
    seq(a(n), n=0..22);  # Alois P. Heinz, Aug 08 2025
  • Mathematica
    Table[Sum[k!(n-k)!,{k,0,n}],{n,0,20}] (* Harvey P. Dale, Mar 28 2012 *)
    Table[(n+1)!/2^n*Sum[2^k/(k+1),{k,0,n}],{n,0,20}] (* Vaclav Kotesovec, Oct 27 2012 *)
    Round@Table[-2 (n+1)! Re[LerchPhi[2, 1, n+2]], {n, 0, 20}] (* Vladimir Reshetnikov, Nov 12 2015 *)
    Table[(n+1)!*Sum[Binomial[n+1, 2*j+1]/(2*j+1), {j, 0, n}]/2^n, {n, 0, 20}] (* Vaclav Kotesovec, Dec 04 2015 *)
    Series[Exp[-2x] ExpIntegralEi[x]^2, {x, Infinity, 20}][[3]] (* Vladimir Reshetnikov, Apr 24 2016 *)
    Table[2*(-1)^n * Sum[(2^k - 1) * StirlingS1[n, k] * BernoulliB[k], {k, 0, n}], {n, 1, 25}] (* Vaclav Kotesovec, Oct 04 2022 *)
  • PARI
    a(n)=sum(k=0,n,k!*(n-k)!)
    
  • PARI
    a(n)=if(n<0,0,(n+1)!*polcoeff(log(1-x+x^2*O(x^n))/(x/2-1),n+1))
    
  • PARI
    a(n) = my(A = 1, B = 1); for(k=1, n, B *= k; A = (n-k+1)*A + B); A \\ Mikhail Kurkov, Aug 08 2025
    
  • Python
    def a(n: int) -> int:
        if n < 2: return n + 1
        app, ap = 1, 2
        for i in range(2, n + 1):
            app, ap = ap, ((3 * i + 1) * ap - (i * i) * app) >> 1
        return ap
    print([a(n) for n in range(23)])  # Peter Luschny, Aug 08 2025
  • Sage
    f=factorial; [sum(f(k)*f(n-k) for k in (0..n)) for n in (0..20)] # G. C. Greubel, Dec 29 2019
    

Formula

a(n) = n! + ((n+1)/2)*a(n-1), n >= 1. - Leroy Quet, Sep 06 2002
a(n) = ((3n+1)*a(n-1) - n^2*a(n-2))/2, n >= 2. - David W. Wilson, Sep 06 2002; corrected by N. Sato, Jan 27 2010
G.f.: (Sum_{k>=0} k!*x^k)^2. - Vladeta Jovovic, Aug 30 2002
E.g.f: log(1-x)/(x/2 - 1) if offset 1.
Convolution of A000142 [factorial numbers] with itself. - Ross La Haye, Oct 29 2004
a(n) = Sum_{k=0..n+1} k*A145878(n+1,k). - Emeric Deutsch, Oct 28 2008
a(n) = A084938(n+2,2). - Philippe Deléham, Dec 17 2008
a(n) = 2*Integral_{t=0..oo} Ei(t)*exp(-2*t)*t^(n+1) where Ei is the exponential integral function. - Groux Roland, Dec 09 2010
Empirical: a(n-1) = 2^(-n)*(A103213(n) + n!*H(n)) with H(n) harmonic number of order n. - Groux Roland, Dec 18 2010; offset fixed by Vladimir Reshetnikov, Apr 24 2016
O.g.f.: 1/(1-I(x))^2 where I(x) is o.g.f. for A003319. - Geoffrey Critzer, Apr 27 2012
a(n) ~ 2*n!. - Vaclav Kotesovec, Oct 04 2012
a(n) = (n+1)!/2^n * Sum_{k=0..n} 2^k/(k+1). - Vaclav Kotesovec, Oct 27 2012
E.g.f.: 2/((x-1)*(x-2)) + 2*x/(x-2)^2*G(0) where G(k) = 1 + x*(2*k+1)/(2*(k+1) - 4*x*(k+1)^2/(2*x*(k+1) + (2*k+3)/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Dec 14 2012
a(n) = 2 * n! * (1 + Sum_{k>=1} A005649(k-1)/n^k). - Vaclav Kotesovec, Aug 01 2015
From Vladimir Reshetnikov, Nov 12 2015: (Start)
a(n) = -(n+1)!*Re(Beta(2; n+2, 0))/2^(n+1), where Beta(z; a, b) is the incomplete Beta function.
a(n) = -2*(n+1)!*Re(LerchPhi(2, 1, n+2)), where LerchPhi(z, s, a) is the Lerch transcendent. (End)
a(n) = (n+1)!*(H(n+1) + (n+1)*hypergeom([1, 1, -n], [2, 2], -1))/2^(n+1), where H(n) is the harmonic number. - Vladimir Reshetnikov, Apr 24 2016
Expansion of square of continued fraction 1/(1 - x/(1 - x/(1 - 2*x/(1 - 2*x/(1 - 3*x/(1 - 3*x/(1 - ...))))))). - Ilya Gutkovskiy, Apr 19 2017
a(n) = Sum_{k=0..n+1} (-1)^(n-k)*A226158(k)*Stirling1(n+1, k). - Mélika Tebni, Feb 22 2022
E.g.f.: x/((1-x)*(2-x))-(2*log(1-x))/(2-x)^2+1/(1-x). - Vladimir Kruchinin, Dec 17 2022

Extensions

More terms from Michel ten Voorde, Apr 11 2001

A355171 a(n) = Sum_{k=0..n} binomial(n, k + 1)*k!*(n + 1)!/(k + 2)!.

Original entry on oeis.org

0, 1, 7, 50, 406, 3804, 41028, 506064, 7084656, 111690720, 1967421600, 38425449600, 825970435200, 19404363283200, 495012834489600, 13632039812966400, 403120633444300800, 12740557701389414400, 428546132879432601600, 15284163618598275072000, 576073025410937628672000
Offset: 0

Views

Author

Peter Luschny, Jun 22 2022

Keywords

Crossrefs

Programs

  • Maple
    a := n -> n*(n + 1)!*hypergeom([1, 1, 1 - n], [2, 3], -1) / 2;
    seq(simplify(a(n)), n = 0..20);
  • Mathematica
    a[n_] := n * (n + 1)! * HypergeometricPFQ[{1, 1, 1 - n}, {2, 3}, -1]/2; Array[a, 21, 0] (* Amiram Eldar, Jun 22 2022 *)
  • Python
    from math import comb, factorial
    def A355171(n):
        f = factorial(n+1)
        return sum(f*comb(n,k+1)//(k+2)//(k+1) for k in range(n+1)) # Chai Wah Wu, Jun 22 2022

Formula

a(n) = n*(n + 1)!*hypergeom([1, 1, 1 - n], [2, 3], -1) / 2.
a(n) = Sum_{k=0..n} (-1)^(k+1)*k!*A066667(n, k + 1).
E.g.f.: log((1 - x) / (1 - 2*x)) / (1 - x)^2. - Mélika Tebni, Jun 23 2022
a(n) ~ 2^(n+2) * (n-1)!. - Vaclav Kotesovec, Feb 17 2024

A087751 Weighted sum of the harmonic numbers.

Original entry on oeis.org

0, 1, 7, 56, 538, 6124, 81048, 1226112, 20902992, 396857376, 8308373760, 190212376320, 4728556327680, 126865966625280, 3654264347274240, 112484501485977600, 3685202487258163200, 128039255560187596800
Offset: 0

Views

Author

Nicholas C. Singer (nsinger2(AT)cox.net), Oct 02 2003

Keywords

Crossrefs

Programs

  • PARI
    H(n)=sum(j=1,n,1/j); a(n)=n!*sum(j=1,n,binomial(n,j)*H(j))

Formula

a(n) = 2*n*a(n-1) + (n-1)!*(2^n-1); a(0)=0, a(1)=1. a(n)=n! * sum(j=1, n, binomial(n, j)*H(j)), where H(j)=sum(k=1, j, 1/k).
E.g.f.: log((2*x-1)/(x-1))/(2*x-1). a(n) = n!*Sum_{k=1..n} (-1)^(k+1)*2^(n-k)*binomial(n, k)/k. a(n) = n!*Sum_{k=1..n} 2^(n-k)*(2^k-1)/k. - Vladeta Jovovic, Aug 12 2005
a(n) ~ n! * log(n) * 2^n * (1 + (gamma-log(2))/log(n)), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jun 03 2022

A336244 Triangle read by rows: row n gives coefficients T(n,k), in descending powers of m, of a polynomial Q_n(m) (of degree n - 1) in an expression for the number of subdivisions A(m,n) of a grid with two rows.

Original entry on oeis.org

1, 1, 1, 1, 5, 2, 1, 12, 29, 6, 1, 22, 131, 206, 24, 1, 35, 385, 1525, 1774, 120, 1, 51, 895, 6585, 19624, 18204, 720, 1, 70, 1792, 21070, 117019, 281260, 218868, 5040, 1, 92, 3234, 55496, 492849, 2210348, 4483436, 3036144, 40320
Offset: 1

Views

Author

Keywords

Comments

Let P_(m,n) denote a grid with 2 rows that has m points in the top row and n points in the bottom, aligned at the left, and let the bottom left point be at the origin.
For m > n, the number of subdivisions of P_(m,n) is given by A(m,n) = 2^(m-2)/(n-1)!*Q_n(m), where Q_n(m) is some monic polynomial of degree n-1. See Theorem 2, p. 6, in Robeva and Sun (2020).
By symmetry, A(m,n) = A(n,m). For more information and formulas, see A059576.

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k = 1..n) begins
  1;
  1,  1;
  1,  5,   2;
  1, 12,  29,   6;
  1, 22, 131, 206, 24;
  ...
Q_3(m) = m^2 + 5*m + 2.
		

Crossrefs

Programs

  • Maple
    # We assume the rows indexed by the degree of the polynomials, n = 0,1,2,...
    A336244row := proc(n) local p, k, s, b; p := 1;
    b := n -> bernoulli(n, x+1) - bernoulli(n, 1);
    for k from 1 to n-1 do
      s := p + add(coeff(p, x, i-1)*b(i)/i, i=1..k-1);
      p := b(k) + k*s od;
    seq(coeff(p, x, n-i), i=1..n) end:
    seq(A336244row(n), n=0..9); # Peter Luschny, Jul 15 2020
  • Mathematica
    b[n_] := BernoulliB[n, x + 1] - BernoulliB[n, 1]; b[1] = x;
    row[n_] := Module[{p = 1, s}, Do[s = p + Sum[Coefficient[p, x, i-1] b[i]/i, {i, 1, k-1}]; p = b[k] + k s, {k, 1, n-1}]; CoefficientList[p, x] // Reverse];
    row /@ Range[9] // Flatten (* Jean-François Alcover, Aug 21 2020, after Peter Luschny *)
  • PARI
    polf(n) = if (n==0, return(m)); my(p=bernpol(n+1,m)); (subst(p, m, m+1) - subst(p, m, 0))/(n+1);  \\ Faulhaber
    tabl(nn) = {my(p = 1, q); for (n=1, nn, if (n==1, q = p, q = (n-1)*(p + polf(n-2) + sum(i=0, n-3, polcoef(p, i, m)*polf(i)))); print(Vec(q)); p = q;);}

Formula

A(m,n) = (2^(m-2)/(n-1)!) * Sum_{k=1..n} T(n,k)*m^(n-k).
A(m,n) = (2^(m-2)/(n-1)!) * Q_n(m) = A059576(m-1, n-1) (provided the latter is viewed as a square array rather than a triangle).
A(m,n) = (2^(m-2)/(n-2)!) * (Q_(n-1)(m) + Sum_{i=1..m} Q_(n-1)(i)).
A(m,n) = 2*(A(m,n-1) + A(m-1,n) - A(m-1,n-1)) for m > n.
T(n, 1) = 1 and T(n, n) = (n - 1)!.
Conjectures:
(a) T(n,2) = (n - 1)*(3*n - 4)/2.
(b) T(n,3) = (n - 2)*(n - 1)*(27*n^2 - 97*n + 72)/24.
(c) T(n,4) = (n - 3)*(n - 2)*(n - 1)^2*(27*n^2 - 156*n + 208)/48.
(d) T(n, n - 1) = (n - 1)!*Sum_{k=1..n-1} binomial(n-1, k)/k = A103213(n-1).

A355257 Array read by ascending antidiagonals. A(n, k) = k! * [x^k] log((1 - x) / (1 - 2*x)) / (1 - x)^n, for 0 <= k <= n.

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 0, 1, 5, 14, 0, 1, 7, 29, 90, 0, 1, 9, 50, 206, 744, 0, 1, 11, 77, 406, 1774, 7560, 0, 1, 13, 110, 714, 3804, 18204, 91440, 0, 1, 15, 149, 1154, 7374, 41028, 218868, 1285200, 0, 1, 17, 194, 1750, 13144, 85272, 506064, 3036144, 20603520
Offset: 0

Views

Author

Peter Luschny and Mélika Tebni, Jul 01 2022

Keywords

Comments

Conjecture: For p prime, A(n, p) == -1 (mod p) for n >= 0.
Conjecture: Let n >= 0, k >= 1 and k != 4. Then k divides A(n, k) if and only if k is not prime.
From Mélika Tebni, Jul 04 2022: (Start)
Conjecture: The polynomials of A355259 generate the k+1 column of this array.
Conjecture: For p prime and n even, (A(n, p) / (p - 1)) == 1 (mod p). (End)

Examples

			Table A(n, k) begins:
  [0] 0, 1,  3,  14,   90,   744,   7560,    91440,   1285200, ... A029767
  [1] 0, 1,  5,  29,  206,  1774,  18204,   218868,   3036144, ... A103213
  [2] 0, 1,  7,  50,  406,  3804,  41028,   506064,   7084656, ... A355171
  [3] 0, 1,  9,  77,  714,  7374,  85272,  1102968,  15908400, ... A355372
  [4] 0, 1, 11, 110, 1154, 13144, 164136,  2251920,  33923760, ... A355407
  [5] 0, 1, 13, 149, 1750, 21894, 295500,  4320420,  68487120, ... A355414
  [6] 0, 1, 15, 194, 2526, 34524, 502644,  7838928, 131198544, ...
  [7] 0, 1, 17, 245, 3506, 52054, 814968, 13543704, 239548176, ...
		

Crossrefs

Programs

  • Maple
    egf := n -> log((1 - x)/(1 - 2*x))/(1 - x)^n:
    ser := n -> series(egf(n), x, 22):
    row := n -> seq(k!*coeff(ser(n), x, k), k = 0..8):
    seq(print(row(n)), n = 0..8);
    # Alternative:
    A := (n, k) -> add(k!*binomial(k + n - 1, k - j - 1)/(j + 1), j = 0..k-1):
    seq(print(seq(A(n, k), k = 0..8)), n = 0..7);
  • Mathematica
    A[0, 0] = 0; A[n_, k_] := k! * Binomial[n+k-1, k - 1] * HypergeometricPFQ[{1 - k, 1, 1}, {2, n + 1}, -1];
    Table[A[n, k], {n, 0, 8}, {k, 0, 8}] // TableForm

Formula

A(n, k) = k!*Sum_{j=0..k-1} binomial(k + n - 1, k - j - 1) / (j + 1).
A(n, k) = k!*Sum_{j=1..k} binomial(n + k - j - 1, n - 1)*(2^j - 1) / j.
A(n, k) = k!*binomial(n + k - 1, k - 1)*hypergeom([1, 1, 1 - k], [2, n + 1], -1) except for A(0, 0) = 0.

A294117 a(n) = (n!)^2 * Sum_{k=1..n} binomial(n,k) / k^2.

Original entry on oeis.org

1, 9, 139, 3460, 129076, 6831216, 492314544, 46810296576, 5724123883776, 881047053849600, 167511790501401600, 38685942660873830400, 10689310289146278297600, 3485920800452969462169600, 1325434521073620201431040000, 581241452210335678204477440000
Offset: 1

Views

Author

Vaclav Kotesovec, Oct 23 2017

Keywords

Crossrefs

Programs

  • Magma
    I:=[1,9,139,3460]; [n le 4 select I[n] else  (5*n^2- 7*n+3)*Self(n-1)-(n-1)^2*(9*n^2-24*n+17)*Self(n-2)+(n-2)^3*(n-1)^2*(7*n-13)*Self(n-3)-2*(n-3)^3*(n-2)^3*(n-1)^2*Self(n-4): n in [1..16]]; // Vincenzo Librandi, Oct 24 2017
  • Maple
    f:= gfun:-rectoproc({a(n) = (5*n^2 - 7*n + 3)*a(n-1) - (n-1)^2*(9*n^2 - 24*n + 17)*a(n-2) + (n-2)^3*(n-1)^2*(7*n - 13)*a(n-3) - 2*(n-3)^3*(n-2)^3*(n-1)^2*a(n-4),a(1)=1,a(2)=9,a(3)=139,a(4)=3460},a(n),remember):
    map(f, [$1..20]); # Robert Israel, Oct 23 2017
  • Mathematica
    Table[n!^2*Sum[Binomial[n, k]/k^2, {k, 1, n}], {n, 1, 20}]
    Table[n!^2*n*HypergeometricPFQ[{1, 1, 1, 1 - n}, {2, 2, 2}, -1], {n, 1, 20}]

Formula

a(n) = (5*n^2 - 7*n + 3)*a(n-1) - (n-1)^2*(9*n^2 - 24*n + 17)*a(n-2) + (n-2)^3*(n-1)^2*(7*n - 13)*a(n-3) - 2*(n-3)^3*(n-2)^3*(n-1)^2*a(n-4).
a(n) ~ (n!)^2 * 2^(n+2) / n^2.
Showing 1-6 of 6 results.