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.

A306343 Number T(n,k) of defective (binary) heaps on n elements with k defects; triangle T(n,k), n>=0, 0<=k<=max(0,n-1), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 3, 9, 9, 3, 8, 28, 48, 28, 8, 20, 90, 250, 250, 90, 20, 80, 360, 1200, 1760, 1200, 360, 80, 210, 1526, 5922, 12502, 12502, 5922, 1526, 210, 896, 7616, 34160, 82880, 111776, 82880, 34160, 7616, 896, 3360, 32460, 185460, 576060, 1017060, 1017060, 576060, 185460, 32460, 3360
Offset: 0

Views

Author

Alois P. Heinz, Feb 08 2019

Keywords

Comments

A defect in a defective heap is a parent-child pair not having the correct order.
T(n,k) is the number of permutations p of [n] having exactly k indices i in {1,...,n} such that p(i) > p(floor(i/2)).
T(n,0) counts perfect (binary) heaps on n elements (A056971).

Examples

			T(4,0) = 3: 4231, 4312, 4321.
T(4,1) = 9: 2413, 3124, 3214, 3241, 3412, 3421, 4123, 4132, 4213.
T(4,2) = 9: 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2431, 3142.
T(4,3) = 3: 1234, 1243, 1324.
(The examples use max-heaps.)
Triangle T(n,k) begins:
    1;
    1;
    1,    1;
    2,    2,     2;
    3,    9,     9,     3;
    8,   28,    48,    28,      8;
   20,   90,   250,   250,     90,    20;
   80,  360,  1200,  1760,   1200,   360,    80;
  210, 1526,  5922, 12502,  12502,  5922,  1526,  210;
  896, 7616, 34160, 82880, 111776, 82880, 34160, 7616, 896;
  ...
		

Crossrefs

Row sums give A000142.
T(n,floor(n/2)) gives A306356.

Programs

  • Maple
    b:= proc(u, o) option remember; local n, g, l; n:= u+o;
          if n=0 then 1
        else g:= 2^ilog2(n); l:= min(g-1, n-g/2); expand(
             add(add(binomial(j-1, i)*binomial(n-j, l-i)*
             b(i, l-i)*b(j-1-i, n-l-j+i), i=0..min(j-1, l)), j=1..u)+
             add(add(binomial(j-1, i)*binomial(n-j, l-i)*
             b(l-i, i)*b(n-l-j+i, j-1-i), i=0..min(j-1, l)), j=1..o)*x)
          fi
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..10);
  • Mathematica
    b[u_, o_] := b[u, o] = Module[{n = u + o, g, l},
         If[n == 0, 1, g := 2^Floor@Log[2, n]; l = Min[g-1, n-g/2]; Expand[
         Sum[Sum[ Binomial[j-1, i]* Binomial[n-j, l-i]*b[i, l-i]*
         b[j-1-i, n-l-j+i], {i, 0, Min[j-1, l]}], {j, 1, u}]+
         Sum[Sum[Binomial[j - 1, i]* Binomial[n-j, l-i]*b[l-i, i]*
         b[n-l-j+i, j-1-i], {i, 0, Min[j-1, l]}], {j, 1, o}]*x]]];
    T[n_] := CoefficientList[b[n, 0], x];
    T /@ Range[0, 10] // Flatten (* Jean-François Alcover, Feb 17 2021, after Alois P. Heinz *)

Formula

T(n,k) = T(n,n-1-k) for n > 0.
Sum_{k>=0} k * T(n,k) = A001286(n).
Sum_{k>=0} (k+1) * T(n,k) = A001710(n-1) for n > 0.
Sum_{k>=0} (k+2) * T(n,k) = A038720(n) for n > 0.
Sum_{k>=0} (k+3) * T(n,k) = A229039(n) for n > 0.
Sum_{k>=0} (k+4) * T(n,k) = A230056(n) for n > 0.

A282466 a(n) = n*a(n-1) + n!, with n>0, a(0)=5.

Original entry on oeis.org

5, 6, 14, 48, 216, 1200, 7920, 60480, 524160, 5080320, 54432000, 638668800, 8143027200, 112086374400, 1656387532800, 26153487360000, 439378587648000, 7825123418112000, 147254595231744000, 2919482409811968000, 60822550204416000000, 1328364496464445440000
Offset: 0

Views

Author

Bruno Berselli, Feb 22 2017

Keywords

References

  • C. Mariconda and A. Tonolo, Calcolo discreto, Apogeo (2012), page 240 (Example 9.57 gives the recurrence).

Crossrefs

Cf. A229039.
Cf. sequences with formula (n + k)*n!: A052521 (k=-5), A282822 (k=-4), A052520 (k=-3), A052571 (k=-2), A062119 (k=-1), A001563 (k=0), A000142 (k=1), A001048 (k=2), A052572 (k=3), A052644 (k=4), this sequence (k=5).

Programs

  • Magma
    A282466:= func< n | (n+5)*Factorial(n) >; // G. C. Greubel, May 14 2025
    
  • Mathematica
    RecurrenceTable[{a[0] == 5, a[n] == n a[n - 1] + n!}, a, {n, 0, 30}] (* or *)
    Table[(n + 5) n!, {n, 0, 30}]
  • SageMath
    def A282466(n): return (n+5)*factorial(n) # G. C. Greubel, May 14 2025

Formula

E.g.f.: (5 - 4*x)/(1 - x)^2.
a(n) = (n + 5)*n!.
a(n) = 2*A229039(n) for n>0.
From Amiram Eldar, Nov 06 2020: (Start)
Sum_{n>=0} 1/a(n) = 9*e - 24.
Sum_{n>=0} (-1)^n/a(n) = 24 - 65/e. (End)

A230056 G.f.: Sum_{n>=0} (n+3)^n * x^n / (1 + (n+3)*x)^n.

Original entry on oeis.org

1, 4, 9, 30, 132, 720, 4680, 35280, 302400, 2903040, 30844800, 359251200, 4550515200, 62270208000, 915372057600, 14384418048000, 240612083712000, 4268249137152000, 80029671321600000, 1581386305314816000, 32844177110384640000, 715273190403932160000, 16298010552775311360000
Offset: 0

Views

Author

Paul D. Hanna, Oct 07 2013

Keywords

Examples

			O.g.f.: A(x) = 1 + 4*x + 9*x^2 + 30*x^3 + 132*x^4 + 720*x^5 + 4680*x^6 +...
where
A(x) = 1 + 4*x/(1+4*x) + 5^2*x^2/(1+5*x)^2 + 6^3*x^3/(1+6*x)^3 + 7^4*x^4/(1+7*x)^4 + 8^5*x^5/(1+8*x)^5 +...
E.g.f.: E(x) = 1 + 4*x + 9*x^2/2! + 30*x^3/3! + 132*x^4/4! + 720*x^5/5! +...
where
E(x) = 1 + 4*x + 9/2*x^2 + 5*x^3 + 11/2*x^4 + 6*x^5 + 13/2*x^6 + 7*x^7 +...
which is the expansion of: (2 + 4*x - 5*x^2) / (2 - 4*x + 2*x^2).
		

Crossrefs

Programs

  • Maple
    a:=series(add((n+3)^n*x^n/(1+(n+3)*x)^n,n=0..100),x=0,23): seq(coeff(a,x,n),n=0..22); # Paolo P. Lava, Mar 27 2019
  • Mathematica
    a[n_] := (n + 7)*n!/2; a[0] = 1; Array[a, 25, 0] (* Amiram Eldar, Dec 11 2022 *)
  • PARI
    {a(n)=polcoeff( sum(m=0, n, ((m+3)*x)^m / (1 + (m+3)*x +x*O(x^n))^m), n)}
    for(n=0, 20, print1(a(n), ", "))
    
  • PARI
    {a(n)=if(n==0, 1, (n+7) * n!/2 )}
    for(n=0, 20, print1(a(n), ", "))

Formula

a(n) = (n+7) * n!/2 for n>0 with a(0)=1.
E.g.f.: (2 + 4*x - 5*x^2)/(2*(1-x)^2).
From Amiram Eldar, Dec 11 2022: (Start)
Sum_{n>=0} 1/a(n) = 530*e - 10075/7.
Sum_{n>=0} (-1)^n/a(n) = 10085/7 - 3914/e. (End)

A229036 G.f.: Sum_{n>=0} (3*n-1)^n * x^n / (1 + (3*n-1)*x)^n.

Original entry on oeis.org

1, 2, 21, 270, 4212, 77760, 1662120, 40415760, 1102248000, 33331979520, 1107097891200, 40069801094400, 1569793384051200, 66185883219456000, 2988292627358438400, 143855017177487616000, 7355369573944584192000, 398090614491857903616000, 22737098558477268725760000
Offset: 0

Views

Author

Paul D. Hanna, Sep 11 2013

Keywords

Comments

More generally,
if Sum_{n>=0} a(n)*x^n = Sum_{n>=0} (b*n+c)^n * x^n / (1 + (b*n+c)*x)^n,
then Sum_{n>=0} a(n)*x^n/n! = (2 - 2*(b-c)*x + b*(b-2*c)*x^2)/(2*(1-b*x)^2)
so that a(n) = (b*n + (b+2*c)) * b^(n-1) * n!/2 for n>0 with a(0)=1.

Examples

			O.g.f.: A(x) = 1 + 2*x + 21*x^2 + 270*x^3 + 4212*x^4 + 77760*x^5 +...
where
A(x) = 1 + 2*x/(1+2*x) + 5^2*x^2/(1+5*x)^2 + 8^3*x^3/(1+8*x)^3 + 11^4*x^4/(1+11*x)^4 + 14^5*x^5/(1+14*x)^5 +...
E.g.f.: E(x) = 1 + 2*x + 21*x^2/2! + 270*x^3/3! + 4212*x^4/4! + 77760*x^5/5! +...
where
E(x) =  1 + 2*x + 21/2*x^2 + 45*x^3 + 351/2*x^4 + 648*x^5 + 4617/2*x^6 +...
which is the expansion of: (2 - 8*x + 15*x^2) / (2 - 12*x + 18*x^2).
		

Crossrefs

Programs

  • Mathematica
    Join[{1},Table[(3n+1)3^(n-1) n!/2,{n,20}]] (* Harvey P. Dale, Feb 10 2015 *)
  • PARI
    {a(n)=polcoeff( sum(m=0, n, ((3*m-1)*x)^m / (1 + (3*m-1)*x +x*O(x^n))^m), n)}
    for(n=0, 20, print1(a(n), ", "))
    
  • PARI
    {a(n) = if(n==0,1,(3*n+1)*3^(n-1)*n!/2)}
    for(n=0, 20, print1(a(n), ", "))

Formula

a(n) = (3*n+1) * 3^(n-1) * n!/2 for n>0 with a(0)=1.
E.g.f.: (2 - 8*x + 15*x^2)/(2*(1-3*x)^2).
Showing 1-4 of 4 results.