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 10 results.

A027649 a(n) = 2*(3^n) - 2^n.

Original entry on oeis.org

1, 4, 14, 46, 146, 454, 1394, 4246, 12866, 38854, 117074, 352246, 1058786, 3180454, 9549554, 28665046, 86027906, 258149254, 774578834, 2323998646, 6972520226, 20918609254, 62757924914, 188277969046, 564842295746, 1694543664454, 5083664547794, 15251060752246
Offset: 0

Views

Author

Keywords

Comments

Poly-Bernoulli numbers B_n^(k) with k=-2.
Binomial transform of A007051, if both sequences start at 0. Binomial transform of A000225(n+1). - Paul Barry, Mar 24 2003
Euler expands (1-z)/(1-5z+6z^2) and finds the general term. Section 226 of the Introductio indicates that he could have written down the recursion relation: a(n) = 5 a(n-1)-6 a(n-2). - V. Frederick Rickey (fred-rickey(AT)usma.edu), Feb 10 2006
Let R be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xRy if x is a subset of y or y is a subset of x. Then a(n) = |R|. - Ross La Haye, Dec 22 2006
With regard to the comment by Ross La Haye: For proper subsets see A056182. - For nonempty subsets see A091344. - For nonempty proper subsets see a(n+1) in A260217. - Manfred Boergens, Aug 02 2023
If x, y are two n-bit binary strings then a(n) gives the number of pairs (x,y) such that XOR(x, y) = ABS(x - y). - Ramasamy Chandramouli, Feb 15 2009
Equals row sums of the triangular version of A038573. - Gary W. Adamson, Jun 04 2009
Inverse binomial transform of A085350. - Paul Curtz, Nov 14 2009
Related to the number of even a's in a nontrivial cycle (should one exist) in the 3x+1 Problem, where a <= floor(log_2(2*(3^n) - 2^n)). The value n correlates to the number of odds in such a nontrivial cycle. See page 1288 of Crandall's paper. Also, this relation gives another proof that the number of odds divided by the number of evens in a nontrivial cycle is bounded by log 2 / log 3 (this observation does not resolve the finite cycles conjecture as the value could be arbitrarily close to this bound). However, the same argument gives that log 2 / log 3 is less than or equal to the number of odds divided by the number of evens in a divergent sequence (should one exist), as log 2 / log 3 is the limit value for a cycle of an arbitrarily large length, where the length is given by the value n. - Jeffrey R. Goodwin, Aug 04 2011
Row sums of Riordan triangle A106516. - Wolfdieter Lang, Jan 09 2015
Number of restricted barred preferential arrangements having 3 bars in which the sections are all restricted sections such that (for fixed sections i and j) section i or section j is empty. - Sithembele Nkonkobe, Oct 12 2015
This is also row 2 of A281891: for n >= 1, when consecutive positive integers are written as a product of primes in nondecreasing order, a factor of 2 or 3 occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 18 2017
Also row sums of A124929. - Omar E. Pol, Jun 15 2017
This is the sum of A318921(n) for n in the range 2^(k+1) to 2^(k+2)-1. See A318921 for proof. - N. J. A. Sloane, Sep 25 2018
a(n) is also the number of acyclic orientations of the complete bipartite graph K_{2,n}. - Vincent Pilaud, Sep 15 2020
a(n-1) is also the number of n-digit numbers whose largest decimal digit is 2. - Stefano Spezia, Nov 15 2023

References

  • Leonhard Euler, Introductio in analysin infinitorum (1748), section 216.

Crossrefs

Row n = 2 of array A099594.
Also occurs as a row, column, diagonal or as row sums in A038573, A085870, A090888, A106516, A217764, A281891.

Programs

  • Haskell
    a027649 n = a027649_list !! n
    a027649_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (1, 1)
    -- Reinhard Zumkeller, Jun 09 2013
    
  • Magma
    [2*(3^n)-2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    a(n, k):= (-1)^n*sum( (-1)^'m'*'m'!*Stirling2(n,'m')/('m'+1)^k,'m'=0..n);
    seq(a(n, -2), n=0..30);
  • Mathematica
    Table[2(3^n)-2^n,{n,0,30}] (* or *) LinearRecurrence[ {5,-6},{1,4},31]  (* Harvey P. Dale, Apr 22 2011 *)
  • PARI
    a(n)=2*(3^n)-2^n \\ Charles R Greathouse IV, Jul 16 2011
    
  • PARI
    Vec((1-x)/((1-2*x)*(1-3*x)) + O(x^50)) \\ Altug Alkan, Oct 12 2015
    
  • SageMath
    [2*(3^n - 2^(n-1)) for n in (0..30)] # G. C. Greubel, Aug 01 2022

Formula

G.f.: (1-x)/((1-2*x)*(1-3*x)).
a(n) = 3*a(n-1) + 2^(n-1), with a(0) = 1.
a(n) = Sum_{k=0..n} binomial(n, k)*(2^(k+1) - 1). - Paul Barry, Mar 24 2003
Partial sums of A053581. - Paul Barry, Jun 26 2003
Main diagonal of array (A085870) defined by T(i, 1) = 2^i - 1, T(1, j) = 2^j - 1, T(i, j) = T(i-1, j) + T(i-1, j-1). - Benoit Cloitre, Aug 05 2003
a(n) = A090888(n, 3). - Ross La Haye, Sep 21 2004
a(n) = Sum_{k=0..n} binomial(n+2, k+1)*Sum_{j=0..floor(k/2)} A001045(k-2j). - Paul Barry, Apr 17 2005
a(n) = Sum_{k=0..n} Sum_{j=0..n} binomial(n,j)*binomial(j+1,k+1). - Paul Barry, Sep 18 2006
a(n) = A166060(n+1)/6. - Philippe Deléham, Oct 21 2009
a(n) = 5*a(n-1) - 6*a(n-2), a(0)=1, a(1)=4. - Harvey P. Dale, Apr 22 2011
a(n) = A217764(n,2). - Ross La Haye, Mar 27 2013
For n>0, a(n) = 3 * a(n-1) + 2^(n-1) = 2 * (a(n-1) + 3^(n-1)). - J. Conrad, Oct 29 2015
for n>0, a(n) = 2 * (1 + 2^(n-2) + Sum_{x=1..n-2} Sum_{k=0..x-1} (binomial(x-1,k)*(2^(k+1) + 2^(n-x+k)))). - J. Conrad, Dec 10 2015
E.g.f.: exp(2*x)*(2*exp(x) - 1). - Stefano Spezia, May 18 2024

Extensions

Better formulas from David W. Wilson and Michael Somos
Incorrect formula removed by Charles R Greathouse IV, Mar 18 2010
Duplications (due to corrections to A numbers) removed by Peter Munn, Jun 15 2017

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

A056182 First differences of A003063.

Original entry on oeis.org

0, 2, 10, 38, 130, 422, 1330, 4118, 12610, 38342, 116050, 350198, 1054690, 3172262, 9533170, 28632278, 85962370, 258018182, 774316690, 2323474358, 6971471650, 20916512102, 62753730610, 188269580438, 564825518530, 1694510110022, 5083597438930, 15250926534518, 45753048039010
Offset: 0

Views

Author

N. J. A. Sloane, Aug 05 2000

Keywords

Comments

Let V be a binary relation on the power set P(A) of a set A having n = |A| elements such that for every element x, y of P(A), xVy if x is a proper subset of y or y is a proper subset of x. Then a(n) = |V|. - Ross La Haye, Dec 22 2006
With regard to the comment by Ross La Haye: For nonempty subsets see a(n+1) in A260217. - If "proper" is omitted see A027649. - For nonempty subsets with "proper" omitted see A091344. - Manfred Boergens, Sep 04 2023
It appears that a(n) is the number of permutations p of 1,..,(n+2) such that max[p(i+1)-p(i)] is 2. For example, for n=1, the permutations (1,3,2) and (2,1,3) and no others have the desired property, so a(1)=2. This approach gives values in agreement with all listed terms. [John W. Layman, Nov 09 2011]
In the terdragon curve, a(n-1) is the number of enclosed unit triangles in expansion level n. - Kevin Ryde, Oct 20 2020

Crossrefs

3rd column of A056151. Cf. A028243 (partial sums).
A002783(n) - 1.
a(n) = A293181(n+1,3).

Programs

  • Maple
    A056182:=n->2 * (3^n - 2^n); seq(A056182(n), n=0..30); # Wesley Ivan Hurt, Feb 10 2014
  • Mathematica
    Table[ -((-1 + k)^(1-k+n)*(-1+k)!)+k^(-k+n)*k! /. k -> 3, {n, 3, 36} ]
    Table[2 (3^n - 2^n), {n, 0, 30}] (* Wesley Ivan Hurt, Feb 10 2014 *)
    CoefficientList[Series[2 x/((2 x - 1) (3 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 12 2014 *)
    LinearRecurrence[{5,-6},{0,2},30] (* Harvey P. Dale, Sep 22 2015 *)

Formula

a(n) = 2 * (3^n - 2^n).
a(n) = 5*a(n-1)-6*a(n-2). G.f.: 2*x/((2*x-1)*(3*x-1)). [Colin Barker, Dec 10 2012]
a(n) = A217764(n,3). - Ross La Haye, Mar 27 2013
a(n) = sum_{i=1..n} binomial(n, i) * 2^(n - i + 1). - Wesley Ivan Hurt, Feb 10 2014
a(n) = 2 * A001047(n). - Wesley Ivan Hurt, Feb 10 2014
E.g.f.: 2*exp(2*x)*(exp(x) - 1). - Stefano Spezia, May 18 2024

Extensions

More terms from Wouter Meeussen, Aug 05 2000

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

A068293 a(1) = 1; thereafter a(n) = 6*(2^(n-1) - 1).

Original entry on oeis.org

1, 6, 18, 42, 90, 186, 378, 762, 1530, 3066, 6138, 12282, 24570, 49146, 98298, 196602, 393210, 786426, 1572858, 3145722, 6291450, 12582906, 25165818, 50331642, 100663290, 201326586, 402653178, 805306362, 1610612730, 3221225466, 6442450938, 12884901882
Offset: 1

Views

Author

R. H. Hardin, Feb 24 2002

Keywords

Comments

1/4 the number of colorings of an n X n octagonal array with 4 colors.
Consider the planar net 3^6 (as in the top left figure in the uniform planar nets link). Then a(n) is the total number of ways that a spider starting at a point P can reach any point n steps away by using a path of length n. - N. J. A. Sloane, Feb 20 2016
From Gary W. Adamson, Jan 13 2009: (Start)
Equals inverse binomial transform of A091344: (1, 7, 31, 115, 391, ...).
Equals binomial transform of (1, 5, 7, 5, 7, 5, ...). (End)
For n > 1, number of ternary strings of length n with exactly 2 different digits. - Enrique Navarrete, Nov 20 2020

Crossrefs

Programs

  • Magma
    [1] cat [6*(2^(n-1)-1): n in [2..40]]; // Vincenzo Librandi, Feb 20 2016
  • Mathematica
    a=0; lst={1}; k=6; Do[a+=k; AppendTo[lst, a]; k+=k, {n, 0, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 16 2008 *)
    Transpose[NestList[{First[#]+1,6(2^First[#]-1)}&,{1,1},30]][[2]] (* or *) Join[{1},LinearRecurrence[{3,-2},{6,18},30]] (* Harvey P. Dale, Nov 27 2011 *)
  • PARI
    a(n)=polcoeff(prod(i=1,2,(1+i*x))/(prod(i=1,2,(1-i*x))+x*O(x^n)),n)
    for(n=0,50,print1(a(n),","))
    

Formula

G.f.: (1+x)*(1+2*x)/((1-x)*(1-2*x)). - Benoit Cloitre, Apr 13 2002
a(n) = 3*a(n-1) - 2*a(n-2); a(1)=1, a(2)=6, a(3)=18. - Harvey P. Dale, Nov 27 2011
E.g.f.: 1 - 6*exp(x)*(exp(x) - 1). - Stefano Spezia, May 18 2024

Extensions

More terms from Benoit Cloitre, Apr 13 2002
Old definition (which is now a comment) replaced with explicit formula by N. J. A. Sloane, May 12 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

A091348 a(n) = 24*5^n - 60*4^n + 50*3^n - 15*2^n + 1.

Original entry on oeis.org

0, 1, 31, 391, 3451, 25231, 164731, 999391, 5767051, 32122831, 174397531, 929043391, 4879252651, 25349936431, 130617150331, 668714319391, 3406562690251, 17286209766031, 87448932863131, 441329102667391, 2223021985199851, 11180731992411631, 56166496811775931, 281884877304327391
Offset: 0

Views

Author

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

Keywords

Crossrefs

Programs

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

Formula

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

Extensions

More terms from Michel Marcus, Oct 21 2022

A260217 Number of base-3 n-digit pandigital numbers.

Original entry on oeis.org

0, 0, 4, 24, 100, 360, 1204, 3864, 12100, 37320, 114004, 346104, 1046500, 3155880, 9500404, 28566744, 85831300, 257756040, 773792404, 2322425784, 6969374500, 20912317800, 62745342004, 188252803224, 564791964100, 1694443001160, 5083463221204, 15250658099064
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 19 2015

Keywords

Comments

From Manfred Boergens, Aug 02 2023: (Start)
a(n+1) is the number of pairs (A,B) where A and B are nonempty subsets of {1,2,...,n} and one of these subsets is a proper subset of the other.
If "proper" is omitted, see A091344.
If empty subsets are included, see A027649 (all subsets) and A056182 (proper subsets). (End)

Examples

			a(3)=4 because, in base 3, there are four 3-digit pandigital numbers (11=102_3, 15=120_3, 19=201_3, and 21=210_3).
a(4)=24 because, in base 3, there are 24 4-digit pandigital numbers (1002_3, 1012_3, 1020_3, 1021_3, 1022_3, 1102_3, 1120_3, 1200_3, 1201_3, 1202_3, 1210_3, 1220_3, 2001_3, 2010_3, 2011_3, 2012_3, 2021_3, 2100_3, 2101_3, 2102_3, 2110_3, 2120_3, 2201_3, and 2210_3).
		

Crossrefs

Programs

  • Magma
    [2*3^(n-1) - 2^(n+1) + 2: n in [1..30]]; // Vincenzo Librandi, Jul 20 2015
  • Mathematica
    Table[2 3^(n - 1) - 2^(n + 1) + 2, {n, 30}] (* Vincenzo Librandi, Jul 20 2015 *)

Formula

a(n) = 2*A028243(n) = 2*3^(n-1) - 2^(n+1) + 2.
a(n) = 4*A000392(n).
G.f.: 4*x^3/((1-x)*(1-2*x)*(1-3*x)).
E.g.f.: 2/3*((exp(x)-1)^3).

A383910 Expansion of Product_{k=0..3} (1 + k*x)/(1 - k*x).

Original entry on oeis.org

1, 12, 72, 312, 1152, 3912, 12672, 39912, 123552, 378312, 1150272, 3481512, 10505952, 31640712, 95167872, 285995112, 858968352, 2578871112, 7740545472, 23229500712, 69704230752, 209144149512, 627495363072, 1882611918312, 5648087413152, 16944765555912, 50835303300672
Offset: 0

Views

Author

Seiichi Manyama, May 14 2025

Keywords

Crossrefs

Column k=3 of A383900.

Programs

  • PARI
    a(n) = if(n==0, 1, 20*3^n-15*2^(n+1)+12);

Formula

a(n) = 6*a(n-1) - 11*a(n-2) + 6*a(n-3) for n > 3.
a(n) = Sum_{k=0..3} |Stirling1(4,k+1)| * Stirling2(k+n,3).
a(n) = A383912(n) + 3*A383912(n-1) = 20*3^n - 15*2^(n+1) + 12 = 10*A091344(n) + 2 for n > 0.

A227341 Triangular array: Number of partitions of the vertex set of a forest of two trees on n vertices into k nonempty independent sets.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, 0, 2, 4, 1, 0, 2, 10, 7, 1, 0, 2, 22, 31, 11, 1, 0, 2, 46, 115, 75, 16, 1, 0, 2, 94, 391, 415, 155, 22, 1, 0, 2, 190, 1267, 2051, 1190, 287, 29, 1, 0, 2, 382, 3991, 9471, 8001, 2912, 490, 37, 1, 0, 2, 766, 12355, 41875, 49476, 25473, 6342, 786, 46, 1
Offset: 1

Views

Author

Peter Bala, Jul 10 2013

Keywords

Comments

For a graph G and a positive integer k, the graphical Stirling number S(G;k) is the number of set partitions of the vertex set of G into k nonempty independent sets (an independent set in G is a subset of the vertices, no two elements of which are adjacent).
Here we take the graph G to be a forest of two trees on n vertices. The corresponding graphical Stirling numbers S(G;k) do not depend on the choice of the trees. See Galvin and Thanh. If the graph G is a single tree on n vertices then the graphical Stirling numbers S(G;k) are the classical Stirling numbers of the second kind A008277. See also A105794.

Examples

			Triangle begins
n\k | 1 2  3   4   5  6  7
= = = = = = = = = = = = =
  1 | 1
  2 | 1 1
  3 | 0 2  1
  4 | 0 2  4   1
  5 | 0 2 10   7   1
  6 | 0 2 22  31  11  1
  7 | 0 2 46 115  75 16  1
Connection constants: Row 5: 2*x*(x-1) + 10*x*(x-1)*(x-2) + 7*x*(x-1)*(x-2)*(x-3) + x*(x-1)*(x-2)*(x-3)*(x-4) = x^2*(x-1)^3.
		

Crossrefs

A008277, A011968 (row sums), A033484 (col. 3), A091344 (col. 4), A105794.

Formula

T(n,k) = Stirling2(n-1,k-1) + Stirling2(n-2,k-1), n,k >= 1.
Recurrence equation: T(n,k) = (k-1)*T(n-1,k) + T(n-1,k-1). Cf. A105794.
k-th column o.g.f.: x^k*(1+x)/((1-x)*(1-2*x)*...*(1-(k-1)*x)).
For n >= 2, sum {k = 0..n} T(n,k)*x_(k) = x^2*(x-1)^(n-2), where x_(k) = x*(x-1)*...*(x-k+1) is the falling factorial.
Column 3: A033484; Column 4: A091344; Row sums are essentially A011968.
Showing 1-10 of 10 results.