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.

A055596 Expansion of e.g.f. (2 - x - 2*exp(-x))/(1-x).

Original entry on oeis.org

1, 0, 2, 6, 32, 190, 1332, 10654, 95888, 958878, 10547660, 126571918, 1645434936, 23036089102, 345541336532, 5528661384510, 93987243536672, 1691770383660094, 32143637289541788, 642872745790835758, 13500327661607550920, 297007208555366120238
Offset: 1

Views

Author

Gary Detlefs, Jul 10 2000

Keywords

Comments

It appears that a(n) = n*a(n-1) + 2(-1)^(n+1) and that the n-th term of any sequence of the form {A(0) =a, A(1)= b, A(n) = (n-1)(A(n-1)+A(n-2))} is A(n) = b*A000166(n) + a*A055596(n). A(n) can also be expressed as A(n) = n*A(n-1) + (2a-b)(-1)^(n+1). - Gary Detlefs, Jun 13 2009
For n>1, sum over all permutations beginning with an ascent, ending with a descent, and without double ascents on n elements and each contributes 2 to the power of the number of double descents. By symmetry, also the sum over all permutations with a descent, ending with an ascent, and no double ascents and the sum is (again) over 2 to the power of the number of double descents. - Richard Ehrenborg, Oct 08 2013
It also appears related to a Secret Santa problem: given n people getting names from an urn to give presents and putting them back in the urn if they get their own name, this seems to be the number of ways that it may fail for the last person, as he/she has no other name to get from the urn. - João Batista Souza de Oliveira, Jan 25 2016

Examples

			a(4)=6 since the 3 permutations 1432, 2431, 3421 all have one double descent and hence each contributes 2 to the sum. - _Richard Ehrenborg_, Oct 08 2013
For the Secret Santa, a(3)=2 since person 1 will get the names of either person 2 or 3. Suppose it was person 2. Person 2 will then get either person 1 or person 3. If he/she gets person 1, the draw will fail for person 3. The other case occurs when person 1 draws person 3, person 3 draws person 1 and the draw fails for person 2. - _João Batista Souza de Oliveira_, Jan 25 2016
		

Crossrefs

Programs

  • Magma
    A055596:= func< n | Factorial(n)*(1 -2*(&+[(-1)^j/Factorial(j): j in [0..n]]) ) >;
    [A055596(n): n in [1..30]]; // G. C. Greubel, Sep 06 2022
    
  • Mathematica
    Rest[CoefficientList[Series[(2-x-2*E^(-x))/(1-x), {x, 0, 20}], x]* Range[0, 20]!] (* Vaclav Kotesovec, Oct 07 2013 *)
  • PARI
    a(n)=if(n<2, n>0, n*a(n-1)-2*(-1)^n)
    
  • PARI
    a(n)=if(n<1,0,n!*polcoeff((2-x-2*exp(-x+x*O(x^n)))/(1-x),n))
    
  • SageMath
    def A055596(n): return factorial(n)*( 2*bool(n==0) + 1 - 2*sum((-1)^j/factorial(j) for j in (0..n)) )
    [A055596(n) for n in (1..30)] # G. C. Greubel, Sep 06 2022

Formula

E.g.f.: (2-x-2*exp(-x))/(1-x).
a(n) = (n-1)*(a(n-1) + a(n-2)) = 2*A006347(n-1), n>2.
a(n) = n! - 2*A000166(n), n>0.
a(n) ~ n! * (1-2*exp(-1)). - Vaclav Kotesovec, Oct 07 2013
For n>2, a(n) = floor(n! * (1-2*exp(-1)) + 1/2). - Peter Bala, Oct 08 2013
a(n+1) = 2*A002467(n) - n!. - Vaclav Kotesovec, Oct 08 2013

Extensions

More terms from James Sellers, Jul 11 2000

A176408 a(n) = (n+1)*(a(n-1) +a(n-2)) n>1, a(0)=1,a(1)=0.

Original entry on oeis.org

1, 0, 3, 12, 75, 522, 4179, 37608, 376083, 4136910, 49642923, 645357996, 9035011947, 135525179202, 2168402867235, 36862848742992, 663531277373859, 12607094270103318
Offset: 0

Views

Author

Gary Detlefs, Apr 16 2010

Keywords

Comments

a(n) is one of two "basis" sequences for sequences of the form s(0)=a,s(1)=b,s(n)=(n+1)(s(n-1)+s(n-2)), n>1, the other being A006347.
s(n) = a*a(n) + b* A006347(n+1).
s(n) = 1/2*(b-2*a)(n+2)! +(3*a-b)*floor(((n+2)!+1)/e).

Examples

			a(2)= 3*9-24=3, a(3)= 3*44-120=12, a(4)= 3*265-720=75, ...
		

Crossrefs

Programs

  • Maple
    seq(3*floor(((n+2)!+1)/E) - (n+2)!,n=1..20);

Formula

a(n) = 3*floor(((n+2)!+1)/e) - (n+2)!.
a(n) = 3* A000166(n+1) - (n+2)!, where A000166 are the subfactorial numbers.

Extensions

Data section corrected by Indranil Ghosh, Feb 15 2017

A352650 Triangle read by rows: T(n,k) = n * T(n-1,k) + (-1)^(n-k) for 0 <= k <= n with initial values T(n,k) = 0 if n < 0 or k < 0 or k > n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 4, 2, 1, 9, 15, 9, 3, 1, 44, 76, 44, 16, 4, 1, 265, 455, 265, 95, 25, 5, 1, 1854, 3186, 1854, 666, 174, 36, 6, 1, 14833, 25487, 14833, 5327, 1393, 287, 49, 7, 1, 133496, 229384, 133496, 47944, 12536, 2584, 440, 64, 8, 1, 1334961, 2293839, 1334961, 479439, 125361, 25839, 4401, 639, 81, 9, 1
Offset: 0

Views

Author

Werner Schulte, Apr 04 2022

Keywords

Comments

Conjecture 1: T(n,k) = Sum_{i=0..n-k} (-1)^(n+k+i) * A326326(n-k,i) * n^i for 0 <= k <= n.
Conjecture 2: T(n,k) = T(n-k,0) + Sum_{i=1..n-k} T(n-k,i) * T(i+k,k) * k / (i + k - 1) for 0 < k <= n.

Examples

			The triangle T(n,k) for 0 <= k <= n starts:
n\k :       0       1       2      3      4     5    6   7  8  9
================================================================
  0 :       1
  1 :       0       1
  2 :       1       1       1
  3 :       2       4       2      1
  4 :       9      15       9      3      1
  5 :      44      76      44     16      4     1
  6 :     265     455     265     95     25     5    1
  7 :    1854    3186    1854    666    174    36    6   1
  8 :   14833   25487   14833   5327   1393   287   49   7  1
  9 :  133496  229384  133496  47944  12536  2584  440  64  8  1
  etc.
		

Crossrefs

Cf. A000166 (column 0 and 2), A002467 (column 1), A006347 (column 3), A006348 (column 4), A009179 (row sums, signed), A352988 (matrix inverse).

Programs

  • Maple
    T := proc(n,k) option remember;
    if k > n then 0 else n * T(n-1,k) + (-1)^(n-k) fi end:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od; # Peter Luschny, Apr 11 2022

Formula

T(n,n) = 1 for n >= 0.
T(n,n-1) = n - 1 for n > 0.
T(n,n-2) = (n - 1)^2 for n > 1.
T(n,0) = A000166(n) for n >= 0.
T(n,1) = A002467(n) for n > 0.
T(n,2) = A000166(n) for n > 1.
T(n,k) + T(n,k+1) = (n!) / (k!) for 0 <= k <= n.
T(n,k) = (n - 1) * (T(n-1,k) + T(n-2,k)) for 0 <= k < n-1.
T(n,k) = (T(n,k-2) - (k - 2) * T(n,k-1)) / (k - 1) for 1 < k <= n.
The row polynomials p(n,x) = Sum_{k=0..n} T(n,k) * x^k satisfy recurrence equation p(n,x) = (n - 1) * (p(n-1,x) + p(n-2,x)) + x^n for n > 0 with initial value p(0,x) = 1.
Row sums are p(n,1) = abs(A009179(n)) for n >= 0.
Alternating row sums are p(n,-1) = (-1)^n for n >= 0.
T(n,k) * T(n+1,k+1) - T(n+1,k) * T(n,k+1) = (-1)^(n-k) * A094587(n,k) for 0 <= k <= n.
Define 3x3-matrices T(i,j) with n <= i <= n+2 and k <= j <= k+2. Then we have: det(T(i,j)) = 0^(n-k) for 0 <= k <= n.
E.g.f. of column k >= 0: Sum_{n>=k} T(n,k) * t^n / (n!) = (Sum_{n>=k} (-t)^n / (n!)) * (-1)^k / (1 - t).
E.g.f.: Sum_{n>=0, k=0..n} T(n,k) * x^k * t^n / (n!) = (x * exp(x * t) + exp(-t)) / ((1 + x) * (1 - t)).
p(n,x) = Sum_{k=0..n} ((n!)/(k!))*(x^(k+1) + (-1)^k)/(x + 1) for n >= 0.
T(n,k) = Sum_{i=0..n-k} (-1)^i * (n!) / ((k+i)!) for 0 <= k <= n.
T(n,k) equals matrix product of A094587 and A097807.
Showing 1-3 of 3 results.