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.

A329369 Number of permutations of {1,2,...,m} with excedance set constructed by taking m-i (0 < i < m) if b(i-1) = 1 where b(k)b(k-1)...b(1)b(0) (0 <= k < m-1) is the binary expansion of n.

Original entry on oeis.org

1, 1, 3, 1, 7, 3, 7, 1, 15, 7, 17, 3, 31, 7, 15, 1, 31, 15, 37, 7, 69, 17, 37, 3, 115, 31, 69, 7, 115, 15, 31, 1, 63, 31, 77, 15, 145, 37, 81, 7, 245, 69, 155, 17, 261, 37, 77, 3, 391, 115, 261, 31, 445, 69, 145, 7, 675, 115, 245, 15, 391, 31, 63, 1, 127, 63
Offset: 0

Views

Author

Mikhail Kurkov, Nov 12 2019

Keywords

Comments

Another version of A152884.
The excedance set of a permutation p of {1,2,...,m} is the set of indices i such that p(i) > i; it is a subset of {1,2,...,m-1}.
Great work on this subject was done by R. Ehrenborg and E. Steingrimsson, so most of the formulas given below are just their results translated into the language of the sequences which are related to the binary expansion of n.
Conjecture 1: equivalently, number of open tours by a biased rook on a specific f(n) X 1 board, which ends on a white cell, where f(n) = A070941(n) = floor(log_2(2n)) + 1 and cells are colored white or black according to the binary representation of 2n. A cell is colored white if the binary digit is 0 and a cell is colored black if the binary digit is 1. A biased rook on a white cell moves only to the left and otherwise moves only to the right. - Mikhail Kurkov, May 18 2021
Conjecture 2: this sequence is an inverse modulo 2 binomial transform of A284005. - Mikhail Kurkov, Dec 15 2021

Examples

			a(1) = 1 because the 1st excedance set is {m-1} and the permutations of {1,2,...,m} with such excedance set are 21, 132, 1243, 12354 and so on, i.e., for a given m we always have 1 permutation.
a(2) = 3 because the 2nd excedance set is {m-2} and the permutations of {1,2,...,m} with such excedance set are 213, 312, 321, 1324, 1423, 1432, 12435, 12534, 12543 and so on, i.e., for a given m we always have 3 permutations.
a(3) = 1 because the 3rd excedance set is {m-2, m-1} and the permutations of {1,2,...,m} with such excedance set are 231, 1342, 12453 and so on, i.e., for a given m we always have 1 permutation.
		

Crossrefs

Programs

  • Maple
    g:= proc(n) option remember;  2^padic[ordp](n, 2) end:
    a:= proc(n) option remember; `if`(n=0, 1, (h-> a(h)+
         `if`(n::odd, 0, (t-> a(h-t)+a(n-t))(g(h))))(iquo(n, 2)))
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Jan 30 2023
  • Mathematica
    a[n_] := a[n] = Which[n == 0, 1, OddQ[n], a[(n-1)/2], True, a[n/2] + a[n/2 - 2^IntegerExponent[n/2, 2]] + a[n - 2^IntegerExponent[n/2, 2]]];
    a /@ Range[0, 65] (* Jean-François Alcover, Feb 13 2020 *)
  • PARI
    upto(n) = my(A, v1); v1 = vector(n+1, i, 0); v1[1] = 1; for(i=1, n, v1[i+1] = v1[i\2+1] + if(i%2, 0, A = 1 << valuation(i/2, 2); v1[i/2-A+1] + v1[i-A+1])); v1 \\ Mikhail Kurkov, Jun 06 2024

Formula

a(2n+1) = a(n) for n >= 0.
a(2n) = a(n) + a(n - 2^f(n)) + a(2n - 2^f(n)) for n > 0 with a(0) = 1 where f(n) = A007814(n) (equivalent to proposition 2.1 at the page 286, see R. Ehrenborg and E. Steingrimsson link).
a(2^m*(2n+1)) = Sum_{k=0..m} binomial(m+1,k) a(2^k*n) = a(2^m*n) + a(2^(m-1)*(2n+1)) + a(2^(m-1)*(4n+1)) for m > 0, n >= 0 (equivalent to proposition 2.5 at the page 287, see R. Ehrenborg and E. Steingrimsson link).
a(2n) = a(2*g(n)) + a(2n - 2^h(n)) + a(2*g(n) + 2^h(n)) for n > 0 with a(0) = 1 where g(n) = A053645(n), h(n) = A063250(n) (equivalent to proposition 2.1 at the page 286, see R. Ehrenborg and E. Steingrimsson link).
a(2n) = 2*a(n + g(n)) + a(2*g(n)) for n > 0, floor(n/3) < 2^(floor(log_2(n))-1) (in other words, for 2^m + k where 0 <= k < 2^(m-1), m > 0) with a(0) = 1 (just a special case of the previous formula, because for 2^m + k where 0 <= k < 2^(m-1), m > 0 we have 2^h(n) = n - g(n)).
a(2n) = a(f(n,-1)) + a(f(n,0)) + a(f(n,1)) for n > 0 with a(0) = 1 where f(n,k) = 2*(f(floor(n/2),k) + n mod 2) + k*A036987(n) for n > 1 with f(1,k) = abs(k) (equivalent to a(2n) = a(2*g(n)) + a(2n - 2^h(n)) + a(2*g(n) + 2^h(n))).
a(n) = Sum_{j=0..2^wt(n) - 1} (-1)^(wt(n) - wt(j)) Product_{k=0..wt(n) - 1} (1 + wt(floor(j/2^k)))^T(n,k) for n > 0 with a(0) = 1 where wt(n) = A000120(n), T(n,k) = T(floor(n/2), k - n mod 2) for k > 0 with T(n,0) = A001511(n) (equivalent to theorem 6.3 at page 296, see R. Ehrenborg and E. Steingrimsson link). Here T(n, k) - 1 for k > 0 is the length of the run of zeros between k-th pair of ones from the right side in the binary expansion of n. Conjecture 1: this formula is equivalent to inverse modulo 2 binomial transform of A284005.
Sum_{k=0..2^n-1} a(k) = (n+1)! for n >= 0.
a((4^n-1)/3) = A110501(n+1) for n >= 0.
a(2^2*(2^n-1)) = A091344(n+1),
a(2^3*(2^n-1)) = A091347(n+1),
a(2^4*(2^n-1)) = A091348(n+1).
More generally, a(2^m*(2^n-1)) = a(2^n*(2^m-1)) = S(n+1,m) for n >= 0, m >= 0 where S(n,m) = Sum_{k=1..n} k!*k^m*Stirling2(n,k)*(-1)^(n-k) (equivalent to proposition 6.5 at the page 297, see R. Ehrenborg and E. Steingrimsson link).
Conjecture 2: a(n) = (1 + A023416(n))*a(g(n)) + Sum_{k=0..floor(log_2(n))-1} (1-R(n,k))*a(g(n) + 2^k*(1 - R(n,k))) for n > 1 with a(0) = 1, a(1) = 1, where g(n) = A053645(n) and where R(n,k) = floor(n/2^k) mod 2 (at this moment this is the only formula here, which is not related to R. Ehrenborg's and E. Steingrimsson's work and arises from another definition given above, exactly conjectured definition with a biased rook). Here R(n,k) is the (k+1)-th bit from the right side in the binary expansion of n. - Mikhail Kurkov, Jun 23 2021
From Mikhail Kurkov, Jan 23 2023: (Start)
The formulas below are not related to R. Ehrenborg's and E. Steingrimsson's work.
Conjecture 3: a(n) = A357990(n, 1) for n >= 0.
Conjecture 4: a(2^m*(2k+1)) = Sum_{i=1..wt(k) + 2} i!*i^m*A358612(k, i)*(-1)^(wt(k) - i) for m >= 0, k >= 0 where wt(n) = A000120(n).
Conjecture 5: a(2^m*(2^n - 2^p - 1)) = Sum_{i=1..n} i!*i^m*(-1)^(n - i)*((i - p + 1)*Stirling2(n, i) - Stirling2(n - p, i - p) + Sum_{j=0..p-2} (p - j - 1)*Stirling2(n - p, i - j)/j! Sum_{k=0..j} (i - k)^p*binomial(j, k)*(-1)^k) for n > 2, m >= 0, 0 < p < n - 1. Here we consider that Stirling2(n, k) = 0 for n >= 0, k < 0. (End)
Conjecture 6: a(2^m*n + q) = Sum_{i=A001511(n+1)..A000120(n)+1} A373183(n, i)*a(2^m*(2^(i-1)-1) + q) for n >= 0, m >= 0, q >= 0. Note that this formula is recursive for n != 2^k - 1. Also, it is not related to R. Ehrenborg's and E. Steingrimsson's work. - Mikhail Kurkov, Jun 05 2024
From Mikhail Kurkov, Jul 10 2024: (Start)
a(2^m*(2^n*(2k+1) - 1)) = Sum_{i=1..m+1} a(2^i*k)*(-1)^(m-i+1)*Sum_{j=i..m+1} j^n*Stirling1(j, i)*Stirling2(m+1, j) for m >= 0, n >= 0, k >= 0 with a(0) = 1.
Proof: start with a(2^m*(2n+1)) = Sum_{k=0..m} binomial(m+1,k) a(2^k*n) given above and rewrite it as a(2^m*(2^n*(2k+1) - 1)) = Sum_{i=0..m} binomial(m+1, i) a(2^i*(2^(n-1)*(2k+1) - 1)).
Then conjecture that a(2^m*(2^n*(2k+1) - 1)) = Sum_{i=1..m+1} a(2^i*k)*f(n, m, i). From that it is obvious that f(0, m, i) = [i = (m+1)].
After that use a(2^m*(2^n*(2k+1) - 1)) = Sum_{i=0..m} binomial(m+1, i) Sum_{j=1..i+1} a(2^j*k)*f(n-1, i, j) = Sum_{i=1..m+1} a(2^i*k) Sum_{j=i-1..m} binomial(m+1, j)*f(n-1, j, i). From that it is obvious that f(n, m, i) = Sum_{j=i-1..m} binomial(m+1, j)*f(n-1, j, i).
Finally, all we need is to show that basic conditions and recurrence for f(n, m, i) gives f(n, m, i) = (-1)^(m-i+1)*Sum_{j=i..m+1} j^n*Stirling1(j, i)*Stirling2(m+1, j) (see Max Alekseyev link).
a(2^m*(2k+1)) = a(2^(m-1)*k) + (m+1)*a(2^m*k) + Sum_{i=1..m-1} a(2^m*k + 2^i) for m > 0, k >= 0.
Proof: start with a(2^(m+1)*(2k+1)) = a(2^m*k) + (m+2)*a(2^(m+1)*k) + Sum_{i=1..m} a(2^(m+1)*k + 2^i).
Then use a(2^m*(4k+1)) = a(2^m*k) + (m+1)*a(2^(m+1)*k) + Sum_{i=1..m-1} a(2^(m+1)*k + 2^i).
From that we get a(2^(m+1)*(2k+1)) - a(2^m*k) - (m+2)*a(2^(m+1)*k) - a(2^(m+1)*k + 2^m) = a(2^m*(4k+1)) - a(2^m*k) - (m+1)*a(2^(m+1)*k).
Finally, a(2^(m+1)*(2k+1)) = a(2^(m+1)*k) + a(2^m*(2*k+1)) + a(2^m*(4k+1)) which agrees with the a(2^m*(2n+1)) = a(2^m*n) + a(2^(m-1)*(2n+1)) + a(2^(m-1)*(4n+1)) given above.
This formula can be considered as an alternative to a(2^m*(2n+1)) = Sum_{k=0..m} binomial(m+1,k) a(2^k*n). There are algorithms for both these formulas that allow you to calculate them without recursion. However, even though it is necessary to calculate binomial coefficients in the mentioned formula, the triple-looped algorithm for it still works faster (see Peter J. Taylor link).
It looks like you can also change v2 in the mentioned algorithm to vector with elements a(2^m*(2^(i+A007814(n+1)-1)-1) + q) to get a(2^m*n + q) instead of a(n). This may have common causes with formula that uses A373183 given above. (End)
From Mikhail Kurkov, Jan 27 2025: (Start)
The formulas below are not related to R. Ehrenborg's and E. Steingrimsson's work.
Conjecture 7: A008292(n+1,k+1) = Sum_{i=0..2^n-1} [A000120(i) = k]*a(i) for n >= 0, k >= 0.
Conjecture 8: a(2^m*(2^n*(2k+1)-1)) = Sum_{i=0..m} Sum_{j=0..m-i} Sum_{q=0..i} binomial(m-i,j)*(m-j+1)^n*a(2^(q+1)*k)*L(m,i,q)*(-1)^j for m >= 0, n > 0, k >= 0 where L(n,k,m) = W(n-m,k-m,m+1) for n > 0, 0 <= k < n, 0 <= m <= k and where W(n,k,m) = (k+m)*W(n-1,k,m) + (n-k)*W(n-1,k-1,m) + [m > 1]*W(n,k,m-1) for 0 <= k < n, m > 0 with W(0,0,m) = 1, W(n,k,m) = 0 for n < 0 or k < 0.
In particular, W(n, k, 1) = A173018(n, k), W(n, k, 2) = A062253(n, k), W(n, k, 3) = A062254(n, k) and W(n, k, 4) = A062255(n, k).
Conjecture 9: a(n) = b(n,wt(n)) for n >= 0 where b(2n+1,k) = b(n,k) + (wt(n)-k+2)*b(n,k-1), b(2n,k) = (wt(n)-k+1)*b(2n+1,k) for n > 0, k > 0 with b(n,0) = A341392(n) for n >= 0, b(0,k) = 0 for k > 0 and where wt(n) = A000120(n) (see A379817).
More generally, a(2^m*(2k+1)) = ((m+1)!)^2*b(k,wt(k)-m) - Sum_{j=1..m} Stirling1(m+2,j+1)*a(2^(j-1)*(2k+1)) for m >= 0, k >= 0. Here we also consider that b(n,k) = 0 for k < 0. (End)
Conjecture 10: if we change b(n,0) = A341392(n) given above to b(n,0) = A341392(n)*x^n, then nonzero terms of the resulting polynomials for b(n,wt(n)) form c(n,k) such that a(n) = Sum_{k=0..A080791(n)} c(n,k) for n >= 0 where c(n,k) = (Product_{i=0..k-1} (1 + 1/A000120(floor(n/2^(A000523(n)-i))))) * Sum_{j=max{0,k-A080791(n)+A080791(A053645(n))}..A080791(A053645(n))} c(A053645(n),j) for n > 0, k >= 0 with c(0,0) = 1, c(0,k) = 0 for k > 0. - Mikhail Kurkov, Jun 19 2025

A136126 Triangle read by rows: T(n,k) is the number of permutations of {1,2,...,k+n} having excedance set {1,2,...,k} (the empty set for k=0), 0 <= k <= n-1.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 7, 1, 1, 15, 31, 15, 1, 1, 31, 115, 115, 31, 1, 1, 63, 391, 675, 391, 63, 1, 1, 127, 1267, 3451, 3451, 1267, 127, 1, 1, 255, 3991, 16275, 25231, 16275, 3991, 255, 1, 1, 511, 12355, 72955, 164731, 164731, 72955, 12355, 511, 1
Offset: 1

Views

Author

Emeric Deutsch, Jan 17 2008

Keywords

Comments

The excedance set of a permutation p in S_n is the set of indices i such that p(i) > i.
Columns 1,2,3,4 yield A000225, A091344, A091347, A091348, respectively. Row sums yield A136127.
T(a+b-1,b-1)*(-1)^(a+b-1) = Sum_{k=0..} F(a,b,k)*(-1)^k where F(a,b,k) is the number of connected subgraphs of K(a,b) (the complete bipartite graph) with k edges. F(n,n,k) is A255192(n,k). - Thomas Dybdahl Ahle, Feb 18 2015 [The sum starts with k=0, and F(n,n,k) is A255192(n,k), but there seems to be no A255192(n,0). Is there no upper k-summation limit? - Wolfdieter Lang, Mar 15 2015]
Comment from Don Knuth, Aug 25 2020, added by N. J. A. Sloane, Sep 07 2020: (Start)
This array also arises from a problem about {0,1}-matrices. Symmetric array read by antidiagonals: A(n,k) (n >= 1, k >= 0) = number of n X k matrices of 0's and 1's satisfying two conditions: (i) no column is entirely 0; (ii) no 0 has simultaneously a 1 above it and another 1 to its left.
Equivalently (see the Steingrímsson-Williams reference) A(n,k) is the number of permutations p_1...p_{n+k} on {1,...,n+k} for which p_1 >= 1, ..., p_n >= n, p_{n+1} < n+1,..., p_{n+k} < n+k. Then A(n,k) = A(k+1,n-1), for n >= 1 and k >= 0.
For example, the seven 2 X 2 matrices satisfying (i) and (ii) are
00 01 10 10 11 11 11
11 11 01 11 00 01 11
and the seven permutations of {1, 2, 3, 4} satisfying the other definition are
1423, 2413, 3412, 3421, 4213, 4312, 4321.
(End)

Examples

			T(4,2) = 7 because 3412, 4312, 2413, 2314, 2431, 3421 and 4321 are the only permutations of {1,2,3,4} with excedance set {1,2}.
Triangle starts:
  1;
  1,   1;
  1,   3,    1;
  1,   7,    7,     1;
  1,  15,   31,    15,     1;
  1,  31,  115,   115,    31,     1;
  1,  63,  391,   675,   391,    63,    1;
  1, 127, 1267,  3451,  3451,  1267,  127,   1;
  1, 255, 3991, 16275, 25231, 16275, 3991, 255, 1;
  ...
Formatted as a square array A(n,k) with 0 <= k <= n:
  1,   1,    1,     1,      1,        1,         1,          1, ... [A000012]
  1,   3,    7,    15,     31,       63,       127,        255, ... [A000225]
  1,   7,   31,   115,    391,     1267,      3991,      12355, ... [A091344]
  1,  15,  115,   675,   3451,    16275,     72955,     316275, ... [A091347]
  1,  31,  391,  3451,  25231,   164731,    999391,    5767051, ... [A091348]
  1,  63, 1267, 16275, 164731,  1441923,  11467387,   85314915, ...
  1, 127, 3991, 72955, 999391, 11467387, 116914351, 1096832395, ...
		

Crossrefs

Programs

  • Maple
    with(combinat): T:=proc(n,k) if k < n then add((-1)^(k+1-i)*factorial(i)*i^(n-1-k)* stirling2(k+1,i),i=1..k+1) else 0 end if end proc: for n to 10 do seq(T(n,k),k=0..n-1) end do; # yields sequence in triangular form
    # Alternatively as a square array:
    A := (n, k) -> add((-1)^(k-j)*j!*Stirling2(k+1,j+1)*(j+1)^(n+1), j=0..k);
    seq(print(seq(A(n, k), k=0..7)), n=0..6); # Peter Luschny, Mar 14 2018
    # Using the exponential generating function as given by Arakawa & Kaneko:
    gf := polylog(-t, 1-exp(-x))/(exp(x)-1):
    ser := series(gf, x, 12): c := n -> n!*coeff(ser, x, n):
    seq(lprint(seq(subs(t=k, c(n)), n=0..8)), k=0..8); # Peter Luschny, Apr 29 2021
    # Using recurrence relations:
    A := proc(n, k) option remember; local j; if n = 0 then return k^n fi;
    add(binomial(k+1, j+1)*A(n-1, k-j), j = 0..k) end:
    for n from 0 to 7 do lprint(seq(A(n, k), k=0..8)) od;  # Peter Luschny, Apr 19 2024
  • Mathematica
    T[n_, k_] := Sum[(-1)^(k + 1 - i)*i!*i^(n - 1 - k)*StirlingS2[k + 1, i], {i, 1, k + 1}];
    Table[T[n, k], {n, 1, 10}, {k, 0, n - 1}] // Flatten (* Jean-François Alcover, Nov 16 2017 *)
  • PARI
    {T(n,k)=polcoeff(polcoeff( x*y*sum(m=0, n, m!*x^m*prod(k=1, m, (1+y+k*x*y)/(1+(1+y)*k*x+k^2*x^2*y +x*O(x^n))) ), n,x),k,y)} \\ Paul D. Hanna, Feb 01 2013
    for(n=1, 10,for(k=1,n, print1(T(n,k), ", "));print(""))
    
  • PARI
    tabl(nn) = {default(seriesprecision, nn+1); pol = log(1/(1-(exp(x)-1)*(exp(y)-1))) + O(x^nn); for (n=1, nn-1, poly = n!*polcoeff(pol, n, x); for (k=1, n, print1(k!*polcoeff(poly, k, y), ", ");); print(););} \\ Michel Marcus, Apr 17 2015

Formula

T(n,k) = Sum_{i=1..k+1} (-1)^(k+1-i)*i!*i^(n-1-k)*Stirling2(k+1,i) (0 <= k <= n-1).
G.f.: A(x,y) = x*y*Sum_{n>=1} n! * x^n*Product_{k=1..n} (1 + y + k*x*y) / (1 + (1+y)*k*x + k^2*x^2*y). - Paul D. Hanna, Feb 01 2013
Central terms of triangle equals A092552. - Paul D. Hanna, Feb 01 2013
T(n,k-1) = Sum_{i=0..k, m=0..i} binomial(i,m)*(-1)^(k-m)*i^(n-k)*m^k (1 <= k <= n). - Thomas Dybdahl Ahle, Feb 18 2015
E.g.f.: log(1/(1-(exp(x)-1)*(exp(y)-1))). - Vladimir Kruchinin, Apr 17 2015
Let W(n,k) = k!*Stirling2(n+1, k+1) denote the Worpitzky numbers, then A(n,k) = Sum_{j=0..k} (-1)^(k-j)*W(k,j)*(j+1)^(n+1) enumerates the square array. - Peter Luschny, Mar 14 2018
Assume the missing first row (1,0,0,...) of the array which Ayyer and Bényi call the 'poly-Bernoulli numbers of type C'. Then T(n, k) = p_{n}(k) where p_{n}(x) = Sum_{k=0..n} (-1)^(n-k)*(k+1)^x*Sum_{j=0..n} E1(n,j)*binomial(n-j, n-k), and E1(n, k) are the Eulerian numbers of first order. This reflects the Worpitzky approach to the Bernoulli numbers. This formula can alternatively be written as: T(n, k) = Sum_{j=0..k} (-1)^(k-j)*(j+1)^n*A028246(k+1, j+1). - Peter Luschny, Apr 29 2021

Extensions

Definition corrected. Changed "T(n,k) is the number of permutations of {1,2,...,n}..." to "T(n,k) is the number of permutations of {1,2,...,k+n}..." - Karel Casteels (kcasteel(AT)sfu.ca), Feb 17 2010

A091347 a(n) = 6*4^n - 12*3^n + 7*2^n - 1.

Original entry on oeis.org

0, 1, 15, 115, 675, 3451, 16275, 72955, 316275, 1340251, 5590035, 23054395, 94314675, 383578651, 1553331795, 6270493435, 25253701875, 101530450651, 407669649555, 1635323974075, 6555235693875, 26262769508251, 105176572911315, 421082805640315, 1685460823266675, 6745232212623451
Offset: 0

Views

Author

Mario Catalani (mario.catalani(AT)unito.it), Jan 03 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[6*4^n - 12*3^n + 7*2^n - 1, {n, 0, 25}]
  • PARI
    a(n) = sum(i=1, n, i!*i^3*stirling(n, i, 2)*(-1)^(n-i)); \\ Michel Marcus, Oct 21 2022

Formula

a(n) = Sum_{i=1..n} i!*i^3*Stirling2(n, i)*(-1)^(n-i).

Extensions

More terms from Michel Marcus, Oct 21 2022
Showing 1-3 of 3 results.