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 159 results. Next

A255061 Number of steps to reach 0 when starting from (2^n)-2 and iterating the map x -> x - (number of runs in binary representation of x): a(n) = A255072(A000918(n)).

Original entry on oeis.org

0, 1, 3, 6, 11, 20, 36, 65, 118, 215, 393, 721, 1329, 2463, 4589, 8590, 16142, 30434, 57549, 109114, 207388, 395045, 754027, 1441971, 2762764, 5303466, 10200385, 19656528, 37948281, 73384080, 142115376, 275551755, 534790472, 1038702980, 2018626772, 3924923937, 7634733312
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Apart from a(1)=1, also gives the positions of ones in A255054.

Crossrefs

One less than A255062.
First differences: A255071.
Apart from a(1)=1, a subsequence of A255059.
Analogous sequences: A218600, A226061.

Programs

Formula

a(n) = A255072(A000918(n)).
a(1) = 0; for n > 1, a(n) = a(n-1) + A255071(n-1).
Other identities. For all n >= 1:
a(n) = A255062(n) - 1.

A145654 Partial sums of A000918, starting from index 1.

Original entry on oeis.org

0, 2, 8, 22, 52, 114, 240, 494, 1004, 2026, 4072, 8166, 16356, 32738, 65504, 131038, 262108, 524250, 1048536, 2097110, 4194260, 8388562, 16777168, 33554382, 67108812, 134217674, 268435400, 536870854, 1073741764, 2147483586
Offset: 1

Views

Author

Keywords

Examples

			For n=7, a(7) = 6*2 + 5*2^2 + 4*2^3 + 3*2^4 + 2*2^5 + 1*2^6 = 240. - _Bruno Berselli_, Feb 10 2014
From _Bruno Berselli_, Jul 17 2018: (Start)
Row sums of the triangle:
   0   ......................................    0
   1,  1   ..................................    2
   3,  2,  3   ..............................    8
   6,  5,  5,  6   ..........................   22
  10, 11, 10, 11, 10   ......................   52
  15, 21, 21, 21, 21, 15   ..................  114
  21, 36, 42, 42, 42, 36, 21   ..............  240
  28, 57, 78, 84, 84, 78, 57, 28   ..........  494, etc.
(End)
		

Crossrefs

Programs

  • Haskell
    a145654 n = a145654_list !! (n-1)
    a145654_list = scanl1 (+) $ tail a000918_list
    -- Reinhard Zumkeller, Nov 06 2013
  • Mathematica
    Accumulate[2^Range[30] - 2] (* or *) LinearRecurrence[{4, -5, 2}, {0, 2, 8}, 30] (* Harvey P. Dale, Jul 15 2017 *)

Formula

a(n) = Sum_{i=1..n} A000918(i).
a(n+1) - a(n) = A000918(n+1).
a(n) = A005803(n+1). - R. J. Mathar, Oct 21 2008
From Colin Barker, Jan 11 2012: (Start)
a(n) = 2*(-1 + 2^n - n).
G.f.: 2*x^2/((1-x)^2*(1-2*x)). (End)
a(n+1) = A121173(2*n). - Reinhard Zumkeller, Nov 06 2013
a(n) = Sum_{i=1..n-1} (n-i)*2^i with a(1)=0. - Bruno Berselli, Feb 10 2014
a(n) = 2 * A000295(n). - Alois P. Heinz, May 28 2018

Extensions

Edited by R. J. Mathar, Oct 21 2008

A000225 a(n) = 2^n - 1. (Sometimes called Mersenne numbers, although that name is usually reserved for A001348.)

Original entry on oeis.org

0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295, 8589934591
Offset: 0

Views

Author

Keywords

Comments

This is the Gaussian binomial coefficient [n,1] for q=2.
Number of rank-1 matroids over S_n.
Numbers k such that the k-th central binomial coefficient is odd: A001405(k) mod 2 = 1. - Labos Elemer, Mar 12 2003
This gives the (zero-based) positions of odd terms in the following convolution sequences: A000108, A007460, A007461, A007463, A007464, A061922.
Also solutions (with minimum number of moves) for the problem of Benares Temple, i.e., three diamond needles with n discs ordered by decreasing size on the first needle to place in the same order on the third one, without ever moving more than one disc at a time and without ever placing one disc at the top of a smaller one. - Xavier Acloque, Oct 18 2003
a(0) = 0, a(1) = 1; a(n) = smallest number such that a(n)-a(m) == 0 (mod (n-m+1)), for all m. - Amarnath Murthy, Oct 23 2003
Binomial transform of [1, 1/2, 1/3, ...] = [1/1, 3/2, 7/3, ...]; (2^n - 1)/n, n=1,2,3, ... - Gary W. Adamson, Apr 28 2005
Numbers whose binary representation is 111...1. E.g., the 7th term is (2^7) - 1 = 127 = 1111111 (in base 2). - Alexandre Wajnberg, Jun 08 2005
Number of nonempty subsets of a set with n elements. - Michael Somos, Sep 03 2006
For n >= 2, a(n) is the least Fibonacci n-step number that is not a power of 2. - Rick L. Shepherd, Nov 19 2007
Let P(A) be the power set of an n-element set A. Then a(n+1) = the number of pairs of elements {x,y} of P(A) for which x and y are disjoint and for which either x is a subset of y or y is a subset of x. - Ross La Haye, Jan 10 2008
A simpler way to state this is that it is the number of pairs (x,y) where at least one of x and y is the empty set. - Franklin T. Adams-Watters, Oct 28 2011
2^n-1 is the sum of the elements in a Pascal triangle of depth n. - Brian Lewis (bsl04(AT)uark.edu), Feb 26 2008
Sequence generalized: a(n) = (A^n -1)/(A-1), n >= 1, A integer >= 2. This sequence has A=2; A003462 has A=3; A002450 has A=4; A003463 has A=5; A003464 has A=6; A023000 has A=7; A023001 has A=8; A002452 has A=9; A002275 has A=10; A016123 has A=11; A016125 has A=12; A091030 has A=13; A135519 has A=14; A135518 has A=15; A131865 has A=16; A091045 has A=17; A064108 has A=20. - Ctibor O. Zizka, Mar 03 2008
a(n) is also a Mersenne prime A000668 when n is a prime number in A000043. - Omar E. Pol, Aug 31 2008
a(n) is also a Mersenne number A001348 when n is prime. - Omar E. Pol, Sep 05 2008
With offset 1, = row sums of triangle A144081; and INVERT transform of A009545 starting with offset 1; where A009545 = expansion of sin(x)*exp(x). - Gary W. Adamson, Sep 10 2008
Numbers n such that A000120(n)/A070939(n) = 1. - Ctibor O. Zizka, Oct 15 2008
For n > 0, sequence is equal to partial sums of A000079; a(n) = A000203(A000079(n-1)). - Lekraj Beedassy, May 02 2009
Starting with offset 1 = the Jacobsthal sequence, A001045, (1, 1, 3, 5, 11, 21, ...) convolved with (1, 2, 2, 2, ...). - Gary W. Adamson, May 23 2009
Numbers n such that n=2*phi(n+1)-1. - Farideh Firoozbakht, Jul 23 2009
a(n) = (a(n-1)+1)-th odd numbers = A005408(a(n-1)) for n >= 1. - Jaroslav Krizek, Sep 11 2009
Partial sums of a(n) for n >= 0 are A000295(n+1). Partial sums of a(n) for n >= 1 are A000295(n+1) and A130103(n+1). a(n) = A006127(n) - (n+1). - Jaroslav Krizek, Oct 16 2009
If n is even a(n) mod 3 = 0. This follows from the congruences 2^(2k) - 1 ~ 2*2*...*2 - 1 ~ 4*4*...*4 - 1 ~ 1*1*...*1 - 1 ~ 0 (mod 3). (Note that 2*2*...*2 has an even number of terms.) - Washington Bomfim, Oct 31 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=2,(i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n)=det(A). - Milan Janjic, Jan 26 2010
This is the sequence A(0,1;1,2;2) = A(0,1;3,-2;0) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
a(n) = S(n+1,2), a Stirling number of the second kind. See the example below. - Dennis P. Walsh, Mar 29 2011
Entries of row a(n) in Pascal's triangle are all odd, while entries of row a(n)-1 have alternating parities of the form odd, even, odd, even, ..., odd.
Define the bar operation as an operation on signed permutations that flips the sign of each entry. Then a(n+1) is the number of signed permutations of length 2n that are equal to the bar of their reverse-complements and avoid the set of patterns {(-2,-1), (-1,+2), (+2,+1)}. (See the Hardt and Troyka reference.) - Justin M. Troyka, Aug 13 2011
A159780(a(n)) = n and A159780(m) < n for m < a(n). - Reinhard Zumkeller, Oct 21 2011
This sequence is also the number of proper subsets of a set with n elements. - Mohammad K. Azarian, Oct 27 2011
a(n) is the number k such that the number of iterations of the map k -> (3k +1)/2 == 1 (mod 2) until reaching (3k +1)/2 == 0 (mod 2) equals n. (see the Collatz problem). - Michel Lagneau, Jan 18 2012
For integers a, b, denote by a<+>b the least c >= a such that Hd(a,c) = b (note that, generally speaking, a<+>b differs from b<+>a). Then a(n+1)=a(n)<+>1. Thus this sequence is the Hamming analog of nonnegative integers. - Vladimir Shevelev, Feb 13 2012
Pisano period lengths: 1, 1, 2, 1, 4, 2, 3, 1, 6, 4, 10, 2, 12, 3, 4, 1, 8, 6, 18, 4, ... apparently A007733. - R. J. Mathar, Aug 10 2012
Start with n. Each n generates a sublist {n-1,n-2,...,1}. Each element of each sublist also generates a sublist. Take the sum of all. E.g., 3->{2,1} and 2->{1}, so a(3)=3+2+1+1=7. - Jon Perry, Sep 02 2012
This is the Lucas U(P=3,Q=2) sequence. - R. J. Mathar, Oct 24 2012
The Mersenne numbers >= 7 are all Brazilian numbers, as repunits in base two. See Proposition 1 & 5.2 in Links: "Les nombres brésiliens". - Bernard Schott, Dec 26 2012
Number of line segments after n-th stage in the H tree. - Omar E. Pol, Feb 16 2013
Row sums of triangle in A162741. - Reinhard Zumkeller, Jul 16 2013
a(n) is the highest power of 2 such that 2^a(n) divides (2^n)!. - Ivan N. Ianakiev, Aug 17 2013
In computer programming, these are the only unsigned numbers such that k&(k+1)=0, where & is the bitwise AND operator and numbers are expressed in binary. - Stanislav Sykora, Nov 29 2013
Minimal number of moves needed to interchange n frogs in the frogs problem (see for example the NRICH 1246 link or the Britton link below). - N. J. A. Sloane, Jan 04 2014
a(n) !== 4 (mod 5); a(n) !== 10 (mod 11); a(n) !== 2, 4, 5, 6 (mod 7). - Carmine Suriano, Apr 06 2014
After 0, antidiagonal sums of the array formed by partial sums of integers (1, 2, 3, 4, ...). - Luciano Ancora, Apr 24 2015
a(n+1) equals the number of ternary words of length n avoiding 01,02. - Milan Janjic, Dec 16 2015
With offset 0 and another initial 0, the n-th term of 0, 0, 1, 3, 7, 15, ... is the number of commas required in the fully-expanded von Neumann definition of the ordinal number n. For example, 4 := {0, 1, 2, 3} := {{}, {{}}, {{}, {{}}}, {{}, {{}}, {{}, {{}}}}}, which uses seven commas. Also, for n>0, a(n) is the total number of symbols required in the fully-expanded von Neumann definition of ordinal n - 1, where a single symbol (as usual) is always used to represent the empty set and spaces are ignored. E.g., a(5) = 31, the total such symbols for the ordinal 4. - Rick L. Shepherd, May 07 2016
With the quantum integers defined by [n+1]A001045%20are%20given%20by%20q%20=%20i%20*%20sqrt(2)%20for%20i%5E2%20=%20-1.%20Cf.%20A239473.%20-%20_Tom%20Copeland">q = (q^(n+1) - q^(-n-1)) / (q - q^(-1)), the Mersenne numbers are a(n+1) = q^n [n+1]_q with q = sqrt(2), whereas the signed Jacobsthal numbers A001045 are given by q = i * sqrt(2) for i^2 = -1. Cf. A239473. - _Tom Copeland, Sep 05 2016
For n>1: numbers n such that n - 1 divides sigma(n + 1). - Juri-Stepan Gerasimov, Oct 08 2016
This is also the second column of the Stirling2 triangle A008277 (see also A048993). - Wolfdieter Lang, Feb 21 2017
Except for the initial terms, the decimal representation of the x-axis of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 659", "Rule 721" and "Rule 734", based on the 5-celled von Neumann neighborhood initialized with a single on cell. - Robert Price, Mar 14 2017
a(n), n > 1, is the number of maximal subsemigroups of the monoid of order-preserving partial injective mappings on a set with n elements. - James Mitchell and Wilf A. Wilson, Jul 21 2017
Also the number of independent vertex sets and vertex covers in the complete bipartite graph K_{n-1,n-1}. - Eric W. Weisstein, Sep 21 2017
Sum_{k=0..n} p^k is the determinant of n X n matrix M_(i, j) = binomial(i + j - 1, j)*p + binomial(i+j-1, i), in this case p=2 (empirical observation). - Tony Foster III, May 11 2019
The rational numbers r(n) = a(n+1)/2^(n+1) = a(n+1)/A000079(n+1) appear also as root of the n-th iteration f^{[n]}(c; x) = 2^(n+1)*x - a(n+1)*c of f(c; x) = f^{[0]}(c; x) = 2*x - c as r(n)*c. This entry is motivated by a riddle of Johann Peter Hebel (1760 - 1826): Erstes Rechnungsexempel(Ein merkwürdiges Rechnungs-Exempel) from 1803, with c = 24 and n = 2, leading to the root r(2)*24 = 21 as solution. See the link and reference. For the second problem, also involving the present sequence, see a comment in A130330. - Wolfdieter Lang, Oct 28 2019
a(n) is the sum of the smallest elements of all subsets of {1,2,..,n} that contain n. For example, a(3)=7; the subsets of {1,2,3} that contain 3 are {3}, {1,3}, {2,3}, {1,2,3}, and the sum of smallest elements is 7. - Enrique Navarrete, Aug 21 2020
a(n-1) is the number of nonempty subsets of {1,2,..,n} which don't have an element that is the size of the set. For example, for n = 4, a(3) = 7 and the subsets are {2}, {3}, {4}, {1,3}, {1,4}, {3,4}, {1,2,4}. - Enrique Navarrete, Nov 21 2020
From Eric W. Weisstein, Sep 04 2021: (Start)
Also the number of dominating sets in the complete graph K_n.
Also the number of minimum dominating sets in the n-helm graph for n >= 3. (End)
Conjecture: except for a(2)=3, numbers m such that 2^(m+1) - 2^j - 2^k - 1 is composite for all 0 <= j < k <= m. - Chai Wah Wu, Sep 08 2021
a(n) is the number of three-in-a-rows passing through a corner cell in n-dimensional tic-tac-toe. - Ben Orlin, Mar 15 2022
From Vladimir Pletser, Jan 27 2023: (Start)
a(n) == 1 (mod 30) for n == 1 (mod 4);
a(n) == 7 (mod 120) for n == 3 (mod 4);
(a(n) - 1)/30 = (a(n+2) - 7)/120 for n odd;
(a(n) - 1)/30 = (a(n+2) - 7)/120 = A131865(m) for n == 1 (mod 4) and m >= 0 with A131865(0) = 0. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 8. - Stefano Spezia, Nov 15 2023
Also, number of nodes in a perfect binary tree of height n-1, or: number of squares (or triangles) after the n-th step of the construction of a Pythagorean tree: Start with a segment. At each step, construct squares having the most recent segment(s) as base, and isosceles right triangles having the opposite side of the squares as hypotenuse ("on top" of each square). The legs of these triangles will serve as the segments which are the bases of the squares in the next step. - M. F. Hasler, Mar 11 2024
a(n) is the length of the longest path in the n-dimensional hypercube. - Christian Barrientos, Apr 13 2024
a(n) is the diameter of the n-Hanoi graph. Equivalently, a(n) is the largest minimum number of moves between any two states of the Towers of Hanoi problem (aka problem of Benares Temple described above). - Allan Bickle, Aug 09 2024

Examples

			For n=3, a(3)=S(4,2)=7, a Stirling number of the second kind, since there are 7 ways to partition {a,b,c,d} into 2 nonempty subsets, namely,
  {a}U{b,c,d}, {b}U{a,c,d}, {c}U{a,b,d}, {d}U{a,b,c}, {a,b}U{c,d}, {a,c}U{b,d}, and {a,d}U{b,c}. - _Dennis P. Walsh_, Mar 29 2011
From _Justin M. Troyka_, Aug 13 2011: (Start)
Since a(3) = 7, there are 7 signed permutations of 4 that are equal to the bar of their reverse-complements and avoid {(-2,-1), (-1,+2), (+2,+1)}. These are:
  (+1,+2,-3,-4),
  (+1,+3,-2,-4),
  (+1,-3,+2,-4),
  (+2,+4,-1,-3),
  (+3,+4,-1,-2),
  (-3,+1,-4,+2),
  (-3,-4,+1,+2). (End)
G.f. = x + 3*x^2 + 7*x^3 + 15*x^4 + 31*x^5 + 63*x^6 + 127*x^7 + ...
For the Towers of Hanoi problem with 2 disks, the moves are as follows, so a(2) = 3.
12|_|_ -> 2|1|_ -> _|1|2 -> _|_|12  - _Allan Bickle_, Aug 07 2024
		

References

  • P. Bachmann, Niedere Zahlentheorie (1902, 1910), reprinted Chelsea, NY, 1968, vol. 2, p. 75.
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, Fifth Edition, Addison-Wesley, 2004, p. 134.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.2 Prime Numbers, p. 79.
  • Johann Peter Hebel, Gesammelte Werke in sechs Bänden, Herausgeber: Jan Knopf, Franz Littmann und Hansgeorg Schmidt-Bergmann unter Mitarbeit von Ester Stern, Wallstein Verlag, 2019. Band 3, S. 20-21, Loesung, S. 36-37. See also the link below.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 46, 60, 75-83.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 141.
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, "Tower of Hanoi", Penguin Books, 1987, pp. 112-113.

Crossrefs

Cf. A000043 (Mersenne exponents).
Cf. A000668 (Mersenne primes).
Cf. A001348 (Mersenne numbers with n prime).
Cf. a(n)=A112492(n, 2). Rightmost column of A008969.
a(n) = A118654(n, 1) = A118654(n-1, 3), for n > 0.
Subsequence of A132781.
Smallest number whose base b sum of digits is n: this sequence (b=2), A062318 (b=3), A180516 (b=4), A181287 (b=5), A181288 (b=6), A181303 (b=7), A165804 (b=8), A140576 (b=9), A051885 (b=10).
Cf. A008277, A048993 (columns k=2), A000918, A130330.
Cf. A000225, A029858, A058809, A375256 (Hanoi graphs).

Programs

  • Haskell
    a000225 = (subtract 1) . (2 ^)
    a000225_list = iterate ((+ 1) . (* 2)) 0
    -- Reinhard Zumkeller, Mar 20 2012
    
  • Maple
    A000225 := n->2^n-1; [ seq(2^n-1,n=0..50) ];
    A000225:=1/(2*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation, sequence starting at a(1)
  • Mathematica
    a[n_] := 2^n - 1; Table[a[n], {n, 0, 30}] (* Stefan Steinerberger, Mar 30 2006 *)
    Array[2^# - 1 &, 50, 0] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *)
    NestList[2 # + 1 &, 0, 32] (* Robert G. Wilson v, Feb 28 2011 *)
    2^Range[0, 20] - 1 (* Eric W. Weisstein, Jul 17 2017 *)
    LinearRecurrence[{3, -2}, {1, 3}, 20] (* Eric W. Weisstein, Sep 21 2017 *)
    CoefficientList[Series[1/(1 - 3 x + 2 x^2), {x, 0, 20}], x] (* Eric W. Weisstein, Sep 21 2017 *)
  • PARI
    A000225(n) = 2^n-1  \\ Michael B. Porter, Oct 27 2009
    
  • PARI
    concat(0, Vec(x/((1-2*x)*(1-x)) + O(x^100))) \\ Altug Alkan, Oct 28 2015
    
  • Python
    def A000225(n): return (1<Chai Wah Wu, Jul 06 2022
  • SageMath
    def isMersenne(n): return n == sum([(1 - b) << s for (s, b) in enumerate((n+1).bits())]) # Peter Luschny, Sep 01 2019
    

Formula

G.f.: x/((1-2*x)*(1-x)).
E.g.f.: exp(2*x) - exp(x).
E.g.f. if offset 1: ((exp(x)-1)^2)/2.
a(n) = Sum_{k=0..n-1} 2^k. - Paul Barry, May 26 2003
a(n) = a(n-1) + 2*a(n-2) + 2, a(0)=0, a(1)=1. - Paul Barry, Jun 06 2003
Let b(n) = (-1)^(n-1)*a(n). Then b(n) = Sum_{i=1..n} i!*i*Stirling2(n,i)*(-1)^(i-1). E.g.f. of b(n): (exp(x)-1)/exp(2x). - Mario Catalani (mario.catalani(AT)unito.it), Dec 19 2003
a(n+1) = 2*a(n) + 1, a(0) = 0.
a(n) = Sum_{k=1..n} binomial(n, k).
a(n) = n + Sum_{i=0..n-1} a(i); a(0) = 0. - Rick L. Shepherd, Aug 04 2004
a(n+1) = (n+1)*Sum_{k=0..n} binomial(n, k)/(k+1). - Paul Barry, Aug 06 2004
a(n+1) = Sum_{k=0..n} binomial(n+1, k+1). - Paul Barry, Aug 23 2004
Inverse binomial transform of A001047. Also U sequence of Lucas sequence L(3, 2). - Ross La Haye, Feb 07 2005
a(n) = A099393(n-1) - A020522(n-1) for n > 0. - Reinhard Zumkeller, Feb 07 2006
a(n) = A119258(n,n-1) for n > 0. - Reinhard Zumkeller, May 11 2006
a(n) = 3*a(n-1) - 2*a(n-2); a(0)=0, a(1)=1. - Lekraj Beedassy, Jun 07 2006
Sum_{n>0} 1/a(n) = 1.606695152... = A065442, see A038631. - Philippe Deléham, Jun 27 2006
Stirling_2(n-k,2) starting from n=k+1. - Artur Jasinski, Nov 18 2006
a(n) = A125118(n,1) for n > 0. - Reinhard Zumkeller, Nov 21 2006
a(n) = StirlingS2(n+1,2). - Ross La Haye, Jan 10 2008
a(n) = A024036(n)/A000051(n). - Reinhard Zumkeller, Feb 14 2009
a(n) = A024088(n)/A001576(n). -Reinhard Zumkeller, Feb 15 2009
a(2*n) = a(n)*A000051(n); a(n) = A173787(n,0). - Reinhard Zumkeller, Feb 28 2010
For n > 0: A179857(a(n)) = A024036(n) and A179857(m) < A024036(n) for m < a(n). - Reinhard Zumkeller, Jul 31 2010
From Enrique Pérez Herrero, Aug 21 2010: (Start)
a(n) = J_n(2), where J_n is the n-th Jordan Totient function: (A007434, is J_2).
a(n) = Sum_{d|2} d^n*mu(2/d). (End)
A036987(a(n)) = 1. - Reinhard Zumkeller, Mar 06 2012
a(n+1) = A044432(n) + A182028(n). - Reinhard Zumkeller, Apr 07 2012
a(n) = A007283(n)/3 - 1. - Martin Ettl, Nov 11 2012
a(n+1) = A001317(n) + A219843(n); A219843(a(n)) = 0. - Reinhard Zumkeller, Nov 30 2012
a(n) = det(|s(i+2,j+1)|, 1 <= i,j <= n-1), where s(n,k) are Stirling numbers of the first kind. - Mircea Merca, Apr 06 2013
G.f.: Q(0), where Q(k) = 1 - 1/(4^k - 2*x*16^k/(2*x*4^k - 1/(1 - 1/(2*4^k - 8*x*16^k/(4*x*4^k - 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013
E.g.f.: Q(0), where Q(k) = 1 - 1/(2^k - 2*x*4^k/(2*x*2^k - (k+1)/Q(k+1))); (continued fraction).
G.f.: Q(0), where Q(k) = 1 - 1/(2^k - 2*x*4^k/(2*x*2^k - 1/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 23 2013
a(n) = A000203(2^(n-1)), n >= 1. - Ivan N. Ianakiev, Aug 17 2013
a(n) = Sum_{t_1+2*t_2+...+n*t_n=n} n*multinomial(t_1+t_2 +...+t_n,t_1,t_2,...,t_n)/(t_1+t_2 +...+t_n). - Mircea Merca, Dec 06 2013
a(0) = 0; a(n) = a(n-1) + 2^(n-1) for n >= 1. - Fred Daniel Kline, Feb 09 2014
a(n) = A125128(n) - A000325(n) + 1. - Miquel Cerda, Aug 07 2016
From Ilya Gutkovskiy, Aug 07 2016: (Start)
Binomial transform of A057427.
Sum_{n>=0} a(n)/n! = A090142. (End)
a(n) = A000918(n) + 1. - Miquel Cerda, Aug 09 2016
a(n+1) = (A095151(n+1) - A125128(n))/2. - Miquel Cerda, Aug 12 2016
a(n) = (A079583(n) - A000325(n+1))/2. - Miquel Cerda, Aug 15 2016
Convolution of binomial coefficient C(n,a(k)) with itself is C(n,a(k+1)) for all k >= 3. - Anton Zakharov, Sep 05 2016
a(n) = (A083706(n-1) + A000325(n))/2. - Miquel Cerda, Sep 30 2016
a(n) = A005803(n) + A005408(n-1). - Miquel Cerda, Nov 25 2016
a(n) = A279396(n+2,2). - Wolfdieter Lang, Jan 10 2017
a(n) = n + Sum_{j=1..n-1} (n-j)*2^(j-1). See a Jun 14 2017 formula for A000918(n+1) with an interpretation. - Wolfdieter Lang, Jun 14 2017
a(n) = Sum_{k=0..n-1} Sum_{i=0..n-1} C(k,i). - Wesley Ivan Hurt, Sep 21 2017
a(n+m) = a(n)*a(m) + a(n) + a(m). - Yuchun Ji, Jul 27 2018
a(n+m) = a(n+1)*a(m) - 2*a(n)*a(m-1). - Taras Goy, Dec 23 2018
a(n+1) is the determinant of n X n matrix M_(i, j) = binomial(i + j - 1, j)*2 + binomial(i+j-1, i) (empirical observation). - Tony Foster III, May 11 2019
From Peter Bala, Jun 27 2025: (Start)
For n >= 1, a(3*n)/a(n) = A001576(n), a(4*n)/a(n) = A034496(n), a(5*n)/a(n) = A020514(n) a(6*n)/a(n) = A034665(n), a(7*n)/a(n) = A020516(n) and a(8*n)/a(n) = A034674(n).
exp( Sum_{n >= 1} a(2*n)/a(n)*x^n/n ) = Sum_{n >= 0} a(n+1)*x^n.
Modulo differences in offsets, exp( Sum_{n >= 1} a(k*n)/a(n)*x^n/n ) is the o.g.f. of A006095 (k = 3), A006096 (k = 4), A006097 (k = 5), A006110 (k = 6), A022189 (k = 7), A022190 (k = 8), A022191 (k = 9) and A022192 (k = 10).
The following are all examples of telescoping series:
Sum_{n >= 1} 2^n/(a(n)*a(n+1)) = 1; Sum_{n >= 1} 2^n/(a(n)*a(n+1)*a(n+2)) = 1/9.
In general, for k >= 1, Sum_{n >= 1} 2^n/(a(n)*a(n+1)*...*a(n+k)) = 1/(a(1)*a(2)*...*a(k)*a(k)).
Sum_{n >= 1} 2^n/(a(n)*a(n+2)) = 4/9, since 2^n/(a(n)*a(n+2)) = b(n) - b(n+1), where b(n) = (2/3)*(3*2^(n-1) - 1)/((2^(n+1) - 1)*(2^n - 1)).
Sum_{n >= 1} (-2)^n/(a(n)*a(n+2)) = -2/9, since (-2)^n/(a(n)*a(n+2)) = c(n) - c(n+1), where c(n) = (1/3)*(-2)^n/((2^(n+1) - 1)*(2^n - 1)).
Sum_{n >= 1} 2^n/(a(n)*a(n+4)) = 18/175, since 2^n/(a(n)*a(n+4)) = d(n) - d(n+1), where d(n) = (120*8^n - 140*4^n + 45*2^n - 4)/(15*(2^n - 1)*(2^(n+1) - 1)*(2^(n+2) - 1)*(2^(n+3) - 1)).
Sum_{n >= 1} (-2)^n/(a(n)*a(n+4)) = -26/525, since (-2)^n/(a(n)*a(n+4)) = e(n) - e(n+1), where e(n) = (-1)^n*(40*8^n - 24*4^n + 5*2^n)/(15*(2^n - 1)*(2^(n+1) - 1)*(2^(n+2) - 1)*(2^(n+3) - 1)). (End)

Extensions

Name partially edited by Eric W. Weisstein, Sep 04 2021

A000051 a(n) = 2^n + 1.

Original entry on oeis.org

2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649, 4294967297, 8589934593
Offset: 0

Views

Author

Keywords

Comments

Same as Pisot sequence L(2,3).
Length of the continued fraction for Sum_{k=0..n} 1/3^(2^k). - Benoit Cloitre, Nov 12 2003
See also A004119 for a(n) = 2a(n-1)-1 with first term = 1. - Philippe Deléham, Feb 20 2004
From the second term on (n>=1), in base 2, these numbers present the pattern 1000...0001 (with n-1 zeros), which is the "opposite" of the binary 2^n-2: (0)111...1110 (cf. A000918). - Alexandre Wajnberg, May 31 2005
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=5, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)=(-1)^(n-1)* charpoly(A,3). - Milan Janjic, Jan 27 2010
First differences of A006127. - Reinhard Zumkeller, Apr 14 2011
The odd prime numbers in this sequence form A019434, the Fermat primes. - David W. Wilson, Nov 16 2011
Pisano period lengths: 1, 1, 2, 1, 4, 2, 3, 1, 6, 4, 10, 2, 12, 3, 4, 1, 8, 6, 18, 4, ... . - R. J. Mathar, Aug 10 2012
Is the mentioned Pisano period lengths (see above) the same as A007733? - Omar E. Pol, Aug 10 2012
Only positive integers that are not 1 mod (2k+1) for any k>1. - Jon Perry, Oct 16 2012
For n >= 1, a(n) is the total length of the segments of the Hilbert curve after n iterations. - Kival Ngaokrajang, Mar 30 2014
Frénicle de Bessy (1657) proved that a(3) = 9 is the only square in this sequence. - Charles R Greathouse IV, May 13 2014
a(n) is the number of distinct possible sums made with at most two elements in {1,...,a(n-1)} for n > 0. - Derek Orr, Dec 13 2014
For n > 0, given any set of a(n) lattice points in R^n, there exist 2 distinct members in this set whose midpoint is also a lattice point. - Melvin Peralta, Jan 28 2017
Also the number of independent vertex sets, irredundant sets, and vertex covers in the (n+1)-star graph. - Eric W. Weisstein, Aug 04 and Sep 21 2017
Also the number of maximum matchings in the 2(n-1)-crossed prism graph. - Eric W. Weisstein, Dec 31 2017
Conjecture: For any integer n >= 0, a(n) is the permanent of the (n+1) X (n+1) matrix with M(j, k) = -floor((j - k - 1)/(n + 1)). This conjecture is inspired by the conjecture of Zhi-Wei Sun in A036968. - Peter Luschny, Sep 07 2021

References

  • Paul Bachmann, Niedere Zahlentheorie (1902, 1910), reprinted Chelsea, NY, 1968, vol. 2, p. 75.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 46, 60, 244.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 141.

Crossrefs

Apart from the initial 1, identical to A094373.
See A008776 for definitions of Pisot sequences.
Column 2 of array A103438.
Cf. A007583 (a((n-1)/2)/3 for odd n).

Programs

  • Haskell
    a000051 = (+ 1) . a000079
    a000051_list = iterate ((subtract 1) . (* 2)) 2
    -- Reinhard Zumkeller, May 03 2012
    
  • Magma
    [2^n+1: n in [0..40]]; // G. C. Greubel, Jan 18 2025
  • Maple
    A000051:=-(-2+3*z)/(2*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation
    a := n -> add(binomial(n,k)*bernoulli(n-k,1)*2^(k+1)/(k+1),k=0..n); # Peter Luschny, Apr 20 2009
  • Mathematica
    Table[2^n + 1, {n,0,40}]
    2^Range[0,40] + 1 (* Eric W. Weisstein, Jul 17 2017 *)
    LinearRecurrence[{3, -2}, {2, 3}, 40] (* Eric W. Weisstein, Sep 21 2017 *)
  • PARI
    a(n)=2^n+1
    
  • PARI
    first(n) = Vec((2 - 3*x)/((1 - x)*(1 - 2*x)) + O(x^n)) \\ Iain Fox, Dec 31 2017
    
  • Python
    def A000051(n): return (1<Chai Wah Wu, Dec 21 2022
    

Formula

a(n) = 2*a(n-1) - 1 = 3*a(n-1) - 2*a(n-2).
G.f.: (2-3*x)/((1-x)*(1-2*x)).
First differences of A052944. - Emeric Deutsch, Mar 04 2004
a(0) = 1, then a(n) = (Sum_{i=0..n-1} a(i)) - (n-2). - Gerald McGarvey, Jul 10 2004
Inverse binomial transform of A007689. Also, V sequence in Lucas sequence L(3, 2). - Ross La Haye, Feb 07 2005
a(n) = A127904(n+1) for n>0. - Reinhard Zumkeller, Feb 05 2007
Equals binomial transform of [2, 1, 1, 1, ...]. - Gary W. Adamson, Apr 23 2008
a(n) = A000079(n)+1. - Omar E. Pol, May 18 2008
E.g.f.: exp(x) + exp(2*x). - Mohammad K. Azarian, Jan 02 2009
a(n) = A024036(n)/A000225(n). - Reinhard Zumkeller, Feb 14 2009
From Peter Luschny, Apr 20 2009: (Start)
A weighted binomial sum of the Bernoulli numbers A027641/A027642 with A027641(1)=1 (which amounts to the definition B_{n} = B_{n}(1)).
a(n) = Sum_{k=0..n} C(n,k)*B_{n-k}*2^(k+1)/(k+1). (See also A052584.) (End)
a(n) is the a(n-1)-th odd number for n >= 1. - Jaroslav Krizek, Apr 25 2009
From Reinhard Zumkeller, Feb 28 2010: (Start)
a(n)*A000225(n) = A000225(2*n).
a(n) = A173786(n,0). (End)
If p[i]=Fibonacci(i-4) and if A is the Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise, then, for n>=1, a(n-1)= det A. - Milan Janjic, May 08 2010
a(n+2) = a(n) + a(n+1) + A000225(n). - Ivan N. Ianakiev, Jun 24 2012
a(A006521(n)) mod A006521(n) = 0. - Reinhard Zumkeller, Jul 17 2014
a(n) = 3*A007583((n-1)/2) for n odd. - Eric W. Weisstein, Jul 17 2017
Sum_{n>=0} 1/a(n) = A323482. - Amiram Eldar, Nov 11 2020

A008277 Triangle of Stirling numbers of the second kind, S2(n,k), n >= 1, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 6, 1, 1, 15, 25, 10, 1, 1, 31, 90, 65, 15, 1, 1, 63, 301, 350, 140, 21, 1, 1, 127, 966, 1701, 1050, 266, 28, 1, 1, 255, 3025, 7770, 6951, 2646, 462, 36, 1, 1, 511, 9330, 34105, 42525, 22827, 5880, 750, 45, 1, 1, 1023, 28501, 145750, 246730, 179487, 63987, 11880, 1155, 55, 1
Offset: 1

Views

Author

Keywords

Comments

Also known as Stirling set numbers and written {n, k}.
S2(n,k) counts partitions of an n-set into k nonempty subsets.
From Manfred Boergens, Apr 07 2025: (Start)
With regard to the preceding comment:
For disjoint collections of subsets see A256894.
For arbitrary collections of subsets see A163353.
For arbitrary collections of nonempty subsets see A055154. (End)
Triangle S2(n,k), 1 <= k <= n, read by rows, given by [0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, ...] DELTA [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ...] where DELTA is Deléham's operator defined in A084938.
Number of partitions of {1, ..., n+1} into k+1 nonempty subsets of nonconsecutive integers, including the partition 1|2|...|n+1 if n=k. E.g., S2(3,2)=3 since the number of partitions of {1,2,3,4} into three subsets of nonconsecutive integers is 3, i.e., 13|2|4, 14|2|3, 1|24|3. - Augustine O. Munagi, Mar 20 2005
Draw n cards (with replacement) from a deck of k cards. Let prob(n,k) be the probability that each card was drawn at least once. Then prob(n,k) = S2(n,k)*k!/k^n (see A090582). - Rainer Rosenthal, Oct 22 2005
Define f_1(x), f_2(x), ..., such that f_1(x)=e^x and for n = 2, 3, ..., f_{n+1}(x) = (d/dx)(x*f_n(x)). Then f_n(x) = e^x*Sum_{k=1..n} S2(n,k)*x^(k-1). - Milan Janjic, May 30 2008
From Peter Bala, Oct 03 2008: (Start)
For tables of restricted Stirling numbers of the second kind see A143494 - A143496.
S2(n,k) gives the number of 'patterns' of words of length n using k distinct symbols - see [Cooper & Kennedy] for an exact definition of the term 'pattern'. As an example, the words AADCBB and XXEGTT, both of length 6, have the same pattern of letters. The five patterns of words of length 3 are AAA, AAB, ABA, BAA and ABC giving row 3 of this table as (1,3,1).
Equivalently, S2(n,k) gives the number of sequences of positive integers (N_1,...,N_n) of length n, with k distinct entries, such that N_1 = 1 and N_(i+1) <= 1 + max{j = 1..i} N_j for i >= 1 (restricted growth functions). For example, Stirling(4,2) = 7 since the sequences of length 4 having 2 distinct entries that satisfy the conditions are (1,1,1,2), (1,1,2,1), (1,2,1,1), (1,1,2,2), (1,2,2,2), (1,2,2,1) and (1,2,1,2).
(End)
Number of combinations of subsets in the plane. - Mats Granvik, Jan 13 2009
S2(n+1,k+1) is the number of size k collections of pairwise disjoint, nonempty subsets of [n]. For example: S2(4,3)=6 because there are six such collections of subsets of [3] that have cardinality two: {(1)(23)},{(12)(3)}, {(13)(2)}, {(1)(2)}, {(1)(3)}, {(2)(3)}. - Geoffrey Critzer, Apr 06 2009
Consider a set of A000217(n) balls of n colors in which, for each integer k = 1 to n, exactly one color appears in the set a total of k times. (Each ball has exactly one color and is indistinguishable from other balls of the same color.) a(n+1, k+1) equals the number of ways to choose 0 or more balls of each color in such a way that exactly (n-k) colors are chosen at least once, and no two colors are chosen the same positive number of times. - Matthew Vandermast, Nov 22 2010
S2(n,k) is the number of monotonic-labeled forests on n vertices with exactly k rooted trees, each of height one or less. See link "Counting forests with Stirling and Bell numbers" below. - Dennis P. Walsh, Nov 16 2011
If D is the operator d/dx, and E the operator xd/dx, Stirling numbers are given by: E^n = Sum_{k=1..n} S2(n,k) * x^k*D^k. - Hyunwoo Jang, Dec 13 2011
The Stirling polynomials of the second kind (a.k.a. the Bell / Touchard polynomials) are the umbral compositional inverses of the falling factorials (a.k.a. the Pochhammer symbol or Stirling polynomials of the first kind), i.e., binomial(Bell(.,x),n) = x^n/n! (cf. Copeland's 2007 formulas), implying binomial(xD,n) = binomial(Bell(.,:xD:),n) = :xD:^n/n! where D = d/dx and :xD:^n = x^n*D^n. - Tom Copeland, Apr 17 2014
S2(n,k) is the number of ways to nest n matryoshkas (Russian nesting dolls) so that exactly k matryoshkas are not contained in any other matryoshka. - Carlo Sanna, Oct 17 2015
The row polynomials R(n, x) = Sum_{k=1..n} S2(n, k)*x^k appear in the numerator of the e.g.f. of n-th powers, E(n, x) = Sum_{m>=0} m^n*x^m/m!, as E(n, x) = exp(x)*x*R(n, x), for n >= 1. - Wolfdieter Lang, Apr 02 2017
With offsets 0 for n and k this is the Sheffer product matrix A007318*A048993 denoted by (exp(t), (exp(t) - 1)) with e.g.f. exp(t)*exp(x*(exp(t) - 1)). - Wolfdieter Lang, Jun 20 2017
Number of words on k+1 unlabeled letters of length n+1 with no repeated letters. - Thomas Anton, Mar 14 2019
Also coefficients of moments of Poisson distribution about the origin expressed as polynomials in lambda. [Haight] (see also A331155). - N. J. A. Sloane, Jan 14 2020
k!*S2(n,k) is the number of surjections from an n-element set to a k-element set. - Jianing Song, Jun 01 2022

Examples

			The triangle S2(n, k) begins:
\ k    1       2       3        4         5         6         7         8        9
n \   10      11      12       13        14        15       ...
----------------------------------------------------------------------------------
1  |   1
2  |   1       1
3  |   1       3       1
4  |   1       7       6        1
5  |   1      15      25       10         1
6  |   1      31      90       65        15         1
7  |   1      63     301      350       140        21         1
8  |   1     127     966     1701      1050       266        28         1
9  |   1     255    3025     7770      6951      2646       462        36        1
10 |   1     511    9330    34105     42525     22827      5880       750       45
       1
11 |   1    1023   28501   145750    246730    179487     63987     11880     1155
      55       1
12 |   1    2047   86526   611501   1379400   1323652    627396    159027    22275
    1705      66       1
13 |   1    4095  261625  2532530   7508501   9321312   5715424   1899612   359502
   39325    2431      78        1
14 |   1    8191  788970 10391745  40075035  63436373  49329280  20912320  5135130
  752752   66066    3367       91         1
15 |   1   16383 2375101 42355950 210766920 420693273 408741333 216627840 67128490
12662650 1479478  106470     4550       105         1
...
----------------------------------------------------------------------------------
x^4 = 1 x_(1) + 7 x_(2) + 6 x_(3) + 1 x_(4), where x_(k) = P(x,k) = k!*C(x,k). - _Daniel Forgues_, Jan 16 2016
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 835.
  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 103ff.
  • B. A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • G. Boole, Finite Differences, 5th ed. New York, NY: Chelsea, 1970.
  • C. A. Charalambides, Enumerative Combinatorics, Chapman & Hall/CRC, 2002, Theorem 8.11, pp. 298-299.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 310.
  • J. H. Conway and R. K. Guy, The Book of Numbers, Springer, p. 92.
  • F. N. David, M. G. Kendall, and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 223.
  • S.N. Elaydi, An Introduction to Difference Equations, 3rd ed. Springer, 2005.
  • H. H. Goldstine, A History of Numerical Analysis, Springer-Verlag, 1977; Section 2.7.
  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 244.
  • Frank Avery Haight, Handbook of the Poisson distribution, John Wiley, 1967. See pages 6,7.
  • A. D. Korshunov, Asymptotic behavior of Stirling numbers of the second kind. (Russian) Metody Diskret. Analiz. No. 39 (1983), 24-41.
  • E. Kuz'min and A. I. Shirshov: On the number e, pp. 111-119, eq.(6), in: Kvant Selecta: Algebra and Analysis, I, ed. S. Tabachnikov, Am.Math.Soc., 1999, p. 116, eq. (11).
  • J. Riordan, An Introduction to Combinatorial Analysis, p. 48.
  • J. Stirling, The Differential Method, London, 1749; see p. 7.

Crossrefs

Cf. A008275 (Stirling numbers of first kind), A048993 (another version of this triangle).
See also A331155.
Cf. A000110 (row sums), A102661 (partial row sums).

Programs

  • Haskell
    a008277 n k = a008277_tabl !! (n-1) !! (k-1)
    a008277_row n = a008277_tabl !! (n-1)
    a008277_tabl = map tail $ a048993_tabl  -- Reinhard Zumkeller, Mar 26 2012
    
  • J
    n ((] (1 % !)) * +/@((^~ * (] (1 ^ |.)) * (! {:)@]) i.@>:)) k NB. _Stephen Makdisi, Apr 06 2016
    
  • Magma
    [[StirlingSecond(n,k): k in [1..n]]: n in [1..12]]; // G. C. Greubel, May 22 2019
  • Maple
    seq(seq(combinat[stirling2](n, k), k=1..n), n=1..10); # Zerinvary Lajos, Jun 02 2007
    stirling_2 := (n,k) -> (1/k!) * add((-1)^(k-i)*binomial(k,i)*i^n, i=0..k);
  • Mathematica
    Table[StirlingS2[n, k], {n, 11}, {k, n}] // Flatten (* Robert G. Wilson v, May 23 2006 *)
    BellMatrix[f_, len_] := With[{t = Array[f, len, 0]}, Table[BellY[n, k, t], {n, 0, len - 1}, {k, 0, len - 1}]];
    rows = 12;
    B = BellMatrix[1&, rows];
    Table[B[[n, k]], {n, 2, rows}, {k, 2, n}] // Flatten (* Jean-François Alcover, Jun 28 2018, after Peter Luschny *)
    a[n_, n_] := 1; a[n_, 1] := 1;
    a[n_, k_] := a[n, k] = a[n-1, k-1] + k a[n-1, k]; Flatten@
    Table[a[n, k], {n, 1, 11}, {k, 1, n}] (* Oliver Seipel, Jun 12 2024 *)
    With[{m = 11},
     Flatten@MapIndexed[Take[#, #2[[1]]] &,
       Transpose@
        Table[Range[1, m]! Coefficient[(E^x-1)^k/k! + O[x]^(m+1), x,
    Range[1, m]], {k, 1, m}]]] (* Oliver Seipel, Jun 12 2024 *)
  • Maxima
    create_list(stirling2(n+1,k+1),n,0,30,k,0,n); /* Emanuele Munarini, Jun 01 2012 */
    
  • PARI
    for(n=1,22,for(k=1,n,print1(stirling(n,k,2),", "));print()); \\ Joerg Arndt, Apr 21 2013
    
  • PARI
    Stirling2(n,k)=sum(i=0,k,(-1)^i*binomial(k,i)*i^n)*(-1)^k/k!  \\ M. F. Hasler, Mar 06 2012
    
  • Sage
    stirling_number2 # Danny Rorabaugh, Oct 11 2015
    

Formula

S2(n, k) = k*S2(n-1, k) + S2(n-1, k-1), n > 1. S2(1, k) = 0, k > 1. S2(1, 1) = 1.
E.g.f.: A(x, y) = e^(y*e^x-y). E.g.f. for m-th column: (e^x-1)^m/m!.
S2(n, k) = (1/k!) * Sum_{i=0..k} (-1)^(k-i)*binomial(k, i)*i^n.
Row sums: Bell number A000110(n) = Sum_{k=1..n} S2(n, k), n>0.
S(n, k) = Sum (i_1*i_2*...*i_(n-k)) summed over all (n-k)-combinations {i_1, i_2, ..., i_k} with repetitions of the numbers {1, 2, ..., k}. Also S(n, k) = Sum (1^(r_1)*2^(r_2)*...* k^(r_k)) summed over integers r_j >= 0, for j=1..k, with Sum{j=1..k} r_j = n-k. [Charalambides]. - Wolfdieter Lang, Aug 15 2019.
A019538(n, k) = k! * S2(n, k).
A028248(n, k) = (k-1)! * S2(n, k).
For asymptotics see Hsu (1948), among other sources.
Sum_{n>=0} S2(n, k)*x^n = x^k/((1-x)(1-2x)(1-3x)...(1-kx)).
Let P(n) = the number of integer partitions of n (A000041), p(i) = the number of parts of the i-th partition of n, d(i) = the number of distinct parts of the i-th partition of n, p(j, i) = the j-th part of the i-th partition of n, m(i, j) = multiplicity of the j-th part of the i-th partition of n, and Sum_{i=1..P(n), p(i)=m} = sum running from i=1 to i=P(n) but taking only partitions with p(i)=m parts into account. Then S2(n, m) = Sum_{i=1..P(n), p(i)=m} n!/(Product_{j=1..p(i)} p(i, j)!) * 1/(Product_{j=1..d(i)} m(i, j)!). For example, S2(6, 3) = 90 because n=6 has the following partitions with m=3 parts: (114), (123), (222). Their complexions are: (114): 6!/(1!*1!*4!) * 1/(2!*1!) = 15, (123): 6!/(1!*2!*3!) * 1/(1!*1!*1!) = 60, (222): 6!/(2!*2!*2!) * 1/(3!) = 15. The sum of the complexions is 15+60+15 = 90 = S2(6, 3). - Thomas Wieder, Jun 02 2005
Sum_{k=1..n} k*S2(n,k) = B(n+1)-B(n), where B(q) are the Bell numbers (A000110). - Emeric Deutsch, Nov 01 2006
Recurrence: S2(n+1,k) = Sum_{i=0..n} binomial(n,i)*S2(i,k-1). With the starting conditions S2(n,k) = 1 for n = 0 or k = 1 and S2(n,k) = 0 for k = 0 we have the closely related recurrence S2(n,k) = Sum_{i=k..n} binomial(n-1,i-1)*S2(i-1,k-1). - Thomas Wieder, Jan 27 2007
Representation of Stirling numbers of the second kind S2(n,k), n=1,2,..., k=1,2,...,n, as special values of hypergeometric function of type (n)F(n-1): S2(n,k)= (-1)^(k-1)*hypergeom([ -k+1,2,2,...,2],[1,1,...,1],1)/(k-1)!, i.e., having n parameters in the numerator: one equal to -k+1 and n-1 parameters all equal to 2; and having n-1 parameters in the denominator all equal to 1 and the value of the argument equal to 1. Example: S2(6,k)= seq(evalf((-1)^(k-1)*hypergeom([ -k+1,2,2,2,2,2],[1,1,1,1,1],1)/(k-1)!),k=1..6)=1,31,90,65,15,1. - Karol A. Penson, Mar 28 2007
From Tom Copeland, Oct 10 2007: (Start)
Bell_n(x) = Sum_{j=0..n} S2(n,j) * x^j = Sum_{j=0..n} E(n,j) * Lag(n,-x, j-n) = Sum_{j=0..n} (E(n,j)/n!) * (n!*Lag(n,-x, j-n)) = Sum_{j=0..n} E(n,j) * binomial(Bell.(x)+j, n) umbrally where Bell_n(x) are the Bell / Touchard / exponential polynomials; S2(n,j), the Stirling numbers of the second kind; E(n,j), the Eulerian numbers; and Lag(n,x,m), the associated Laguerre polynomials of order m.
For x = 0, the equation gives Sum_{j=0..n} E(n,j) * binomial(j,n) = 1 for n=0 and 0 for all other n. By substituting the umbral compositional inverse of the Bell polynomials, the lower factorial n!*binomial(y,n), for x in the equation, the Worpitzky identity is obtained; y^n = Sum_{j=0..n} E(n,j) * binomial(y+j,n).
Note that E(n,j)/n! = E(n,j)/(Sum_{k=0..n}E(n,k)). Also (n!*Lag(n, -1, j-n)) is A086885 with a simple combinatorial interpretation in terms of seating arrangements, giving a combinatorial interpretation to the equation for x=1; n!*Bell_n(1) = n!*Sum_{j=0..n} S2(n,j) = Sum_{j=0..n} E(n,j) * (n!*Lag(n, -1, j-n)).
(Appended Sep 16 2020) For connections to the Bernoulli numbers, extensions, proofs, and a clear presentation of the number arrays involved in the identities above, see my post Reciprocity and Umbral Witchcraft. (End)
n-th row = leftmost column of nonzero terms of A127701^(n-1). Also, (n+1)-th row of the triangle = A127701 * n-th row; deleting the zeros. Example: A127701 * [1, 3, 1, 0, 0, 0, ...] = [1, 7, 6, 1, 0, 0, 0, ...]. - Gary W. Adamson, Nov 21 2007
The row polynomials are given by D^n(e^(x*t)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A147315 and A094198. See also A185422. - Peter Bala, Nov 25 2011
Let f(x) = e^(e^x). Then for n >= 1, 1/f(x)*(d/dx)^n(f(x)) = 1/f(x)*(d/dx)^(n-1)(e^x*f(x)) = Sum_{k=1..n} S2(n,k)*e^(k*x). Similar formulas hold for A039755, A105794, A111577, A143494 and A154537. - Peter Bala, Mar 01 2012
S2(n,k) = A048993(n,k), 1 <= k <= n. - Reinhard Zumkeller, Mar 26 2012
O.g.f. for the n-th diagonal is D^n(x), where D is the operator x/(1-x)*d/dx. - Peter Bala, Jul 02 2012
n*i!*S2(n-1,i) = Sum_{j=(i+1)..n} (-1)^(j-i+1)*j!/(j-i)*S2(n,j). - Leonid Bedratyuk, Aug 19 2012
G.f.: (1/Q(0)-1)/(x*y), where Q(k) = 1 - (y+k)*x - (k+1)*y*x^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Nov 09 2013
From Tom Copeland, Apr 17 2014: (Start)
Multiply each n-th diagonal of the Pascal lower triangular matrix by x^n and designate the result as A007318(x) = P(x).
With Bell(n,x)=B(n,x) defined above, D = d/dx, and :xD:^n = x^n*D^n, a Dobinski formula gives umbrally f(y)^B(.,x) = e^(-x)*e^(f(y)*x). Then f(y)^B(.,:xD:)g(x) = [f(y)^(xD)]g(x) = e^[-(1-f(y)):xD:]g(x) = g[f(y)x].
In particular, for f(y) = (1+y),
A) (1+y)^B(.,x) = e^(-x)*e^((1+y)*x) = e^(x*y) = e^[log(1+y)B(.,x)],
B) (I+dP)^B(.,x) = e^(x*dP) = P(x) = e^[x*(e^M-I)]= e^[M*B(.,x)] with dP = A132440, M = A238385-I = log(I+dP), and I = identity matrix, and
C) (1+dP)^(xD) = e^(dP:xD:) = P(:xD:) = e^[(e^M-I):xD:] = e^[M*xD] with action e^(dP:xD:)g(x) = g[(I+dP)*x].
D) P(x)^m = P(m*x), which implies (Sum_{k=1..m} a_k)^j = B(j,m*x) where the sum is umbrally evaluated only after exponentiation with (a_k)^q = B(.,x)^q = B(q,x). E.g., (a1+a2+a3)^2=a1^2+a2^2+a3^2+2(a1*a2+a1*a3+a2*a3) = 3*B(2,x)+6*B(1,x)^2 = 9x^2+3x = B(2,3x).
E) P(x)^2 = P(2x) = e^[M*B(.,2x)] = A038207(x), the face vectors of the n-Dim hypercubes.
(End)
As a matrix equivalent of some inversions mentioned above, A008277*A008275 = I, the identity matrix, regarded as lower triangular matrices. - Tom Copeland, Apr 26 2014
O.g.f. for the n-th diagonal of the triangle (n = 0,1,2,...): Sum_{k>=0} k^(k+n)*(x*e^(-x))^k/k!. Cf. the generating functions of the diagonals of A039755. Also cf. A112492. - Peter Bala, Jun 22 2014
Floor(1/(-1 + Sum_{n>=k} 1/S2(n,k))) = A034856(k-1), for k>=2. The fractional portion goes to zero at large k. - Richard R. Forberg, Jan 17 2015
From Daniel Forgues, Jan 16 2016: (Start)
Let x_(n), called a factorial term (Boole, 1970) or a factorial polynomial (Elaydi, 2005: p. 60), denote the falling factorial Product_{k=0..n-1} (x-k). Then, for n >= 1, x_(n) = Sum_{k=1..n} A008275(n,k) * x^k, x^n = Sum_{k=1..n} T(n,k) * x_(k), where A008275(n,k) are Stirling numbers of the first kind.
For n >= 1, the row sums yield the exponential numbers (or Bell numbers): Sum_{k=1..n} T(n,k) = A000110(n), and Sum_{k=1..n} (-1)^(n+k) * T(n,k) = (-1)^n * Sum_{k=1..n} (-1)^k * T(n,k) = (-1)^n * A000587(n), where A000587 are the complementary Bell numbers. (End)
Sum_{k=1..n} k*S2(n,k) = A138378(n). - Alois P. Heinz, Jan 07 2022
O.g.f. for the m-th column: x^m/(Product_{j=1..m} 1-j*x). - Daniel Checa, Aug 25 2022
S2(n,k) ~ (k^n)/k!, for fixed k as n->oo. - Daniel Checa, Nov 08 2022
S2(2n+k, n) ~ (2^(2n+k-1/2) * n^(n+k-1/2)) / (sqrt(Pi*(1-c)) * exp(n) * c^n * (2-c)^(n+k)), where c = -LambertW(-2 * exp(-2)). - Miko Labalan, Dec 21 2024
From Mikhail Kurkov, Mar 05 2025: (Start)
For a general proof of the formulas below via generating functions, see Mathematics Stack Exchange link.
Recursion for the n-th row (independently of other rows): T(n,k) = 1/(n-k)*Sum_{j=2..n-k+1} (j-2)!*binomial(-k,j)*T(n,k+j-1) for 1 <= k < n with T(n,n) = 1 (see Fedor Petrov link).
Recursion for the k-th column (independently of other columns): T(n,k) = 1/(n-k)*Sum_{j=2..n-k+1} binomial(n,j)*T(n-j+1,k)*(-1)^j for 1 <= k < n with T(n,n) = 1. (End)

A019538 Triangle of numbers T(n,k) = k!*Stirling2(n,k) read by rows (n >= 1, 1 <= k <= n).

Original entry on oeis.org

1, 1, 2, 1, 6, 6, 1, 14, 36, 24, 1, 30, 150, 240, 120, 1, 62, 540, 1560, 1800, 720, 1, 126, 1806, 8400, 16800, 15120, 5040, 1, 254, 5796, 40824, 126000, 191520, 141120, 40320, 1, 510, 18150, 186480, 834120, 1905120, 2328480, 1451520, 362880, 1, 1022, 55980, 818520, 5103000, 16435440, 29635200, 30240000, 16329600, 3628800
Offset: 1

Views

Author

N. J. A. Sloane and Manfred Goebel (goebel(AT)informatik.uni-tuebingen.de), Dec 11 1996

Keywords

Comments

Number of ways n labeled objects can be distributed into k nonempty parcels. Also number of special terms in n variables with maximal degree k.
In older terminology these are called differences of 0. - Michael Somos, Oct 08 2003
Number of surjections (onto functions) from an n-element set to a k-element set.
Also coefficients (in ascending order) of so-called ordered Bell polynomials.
(k-1)!*Stirling2(n,k-1) is the number of chain topologies on an n-set having k open sets [Stephen].
Number of set compositions (ordered set partitions) of n items into k parts. Number of k dimensional 'faces' of the n dimensional permutohedron (see Simion, p. 162). - Mitch Harris, Jan 16 2007
Correction of comment before: Number of (n-k)-dimensional 'faces' of the permutohedron of order n (an (n-1)-dimensional polytope). - Tilman Piesk, Oct 29 2014
This array is related to the reciprocal of an e.g.f. as sketched in A133314. For example, the coefficient of the fourth-order term in the Taylor series expansion of 1/(a(0) + a(1) x + a(2) x^2/2! + a(3) x^3/3! + ...) is a(0)^(-5) * {24 a(1)^4 - 36 a(1)^2 a(2) a(0) + [8 a(1) a(3) + 6 a(2)^2] a(0)^2 - a(4) a(0)^3}. The unsigned coefficients characterize the P3 permutohedron depicted on page 10 in the Loday link with 24 vertices (0-D faces), 36 edges (1-D faces), 6 squares (2-D faces), 8 hexagons (2-D faces) and 1 3-D permutohedron. Summing coefficients over like dimensions gives A019538 and A090582. Compare to A133437 for the associahedron. - Tom Copeland, Sep 29 2008, Oct 07 2008
Further to the comments of Tom Copeland above, the permutohedron of type A_3 can be taken as the truncated octahedron. Its dual is the tetrakis hexahedron, a simplicial polyhedron, with f-vector (1,14,36,24) giving the fourth row of this triangle. See the Wikipedia entry and [Fomin and Reading p. 21]. The corresponding h-vectors of permutohedra of type A give the rows of the triangle of Eulerian numbers A008292. See A145901 and A145902 for the array of f-vectors for type B and type D permutohedra respectively. - Peter Bala, Oct 26 2008
Subtriangle of triangle in A131689. - Philippe Deléham, Nov 03 2008
Since T(n,k) counts surjective functions and surjective functions are "consistent", T(n,k) satisfies a binomial identity, namely, T(n,x+y) = Sum_{j=0..n} C(n,j)*T(j,x)*T(n-j,y). For definition of consistent functions and a generalized binomial identity, see "Toy stories and combinatorial identities" in the link section below. - Dennis P. Walsh, Feb 24 2012
T(n,k) is the number of labeled forests on n+k vertices satisfying the following two conditions: (i) each forest consists of exactly k rooted trees with roots labeled 1, 2, ..., k; (ii) every root has at least one child vertex. - Dennis P. Walsh, Feb 24 2012
The triangle is the inverse binomial transform of triangle A028246, deleting the left column and shifting up one row. - Gary W. Adamson, Mar 05 2012
See A074909 for associations among this array and the Bernoulli polynomials and their umbral compositional inverses. - Tom Copeland, Nov 14 2014
E.g.f. for the shifted signed polynomials is G(x,t) = (e^t-1)/[1+(1+x)(e^t-1)] = 1-(1+x)(e^t-1) + (1+x)^2(e^t-1)^2 - ... (see also A008292 and A074909), which has the infinitesimal generator g(x,u)d/du = [(1-x*u)(1-(1+x)u)]d/du, i.e., exp[t*g(x,u)d/du]u eval. at u=0 gives G(x,t), and dG(x,t)/dt = g(x,G(x,t)). The compositional inverse is log((1-xt)/(1-(1+x)t)). G(x,t) is a generating series associated to the generalized Hirzebruch genera. See the G. Rzadowski link for the relation of the derivatives of g(x,u) to solutions of the Riccatt differential equation, soliton solns. to the KdV equation, and the Eulerian and Bernoulli numbers. In addition A145271 connects products of derivatives of g(x,u) and the refined Eulerian numbers to the inverse of G(x,t), which gives the normalized, reverse face polynomials of the simplices (A135278, divided by n+1). See A028246 for the generator g(x,u)d/dx. - Tom Copeland, Nov 21 2014
For connections to toric varieties and Eulerian polynomials, see the Dolgachev and Lunts and the Stembridge links. - Tom Copeland, Dec 31 2015
See A008279 for a relation between the e.g.f.s enumerating the faces of permutahedra (this entry) and stellahedra. - Tom Copeland, Nov 14 2016
T(n, k) appears in a Worpitzky identity relating monomials to binomials: x^n = Sum_{k=1..n} T(n, k)*binomial(x,k), n >= 1. See eq. (11.) of the Worpitzky link on p. 209. The relation to the Eulerian numbers is given there in eqs. (14.) and (15.). See the formula below relating to A008292. See also Graham et al. eq. (6.10) (relating monomials to falling factorials) on p. 248 (2nd ed. p. 262). The Worpitzky identity given in the Graham et al. reference as eq. (6.37) (2nd ed. p. 269) is eq. (5.), p. 207, of Worpitzky. - Wolfdieter Lang, Mar 10 2017
T(n, m) is also the number of minimum clique coverings and minimum matchings in the complete bipartite graph K_{m,n}. - Eric W. Weisstein, Apr 26 2017
From the Hasan and Franco and Hasan papers: The m-permutohedra for m=1,2,3,4 are the line segment, hexagon, truncated octahedron and omnitruncated 5-cell. The first three are well-known from the study of elliptic models, brane tilings and brane brick models. The m+1 torus can be tiled by a single (m+2)-permutohedron. Relations to toric Calabi-Yau Kahler manifolds are also discussed. - Tom Copeland, May 14 2020
From Manfred Boergens, Jul 25 2021: (Start)
Number of n X k binary matrices with row sums = 1 and no zero columns. These matrices are a subset of the matrices defining A183109.
The distribution into parcels in the leading comment can be regarded as a covering of [n] by tuples (A_1,...,A_k) in P([n])^k with nonempty and disjoint A_j, with P(.) denoting the power set (corrected for clarity by Manfred Boergens, May 26 2024). For the non-disjoint case see A183109 and A218695.
For tuples with "nonempty" dropped see A089072. For tuples with "nonempty and disjoint" dropped see A092477 and A329943 (amendment by Manfred Boergens, Jun 24 2024). (End)

Examples

			The triangle T(n, k) begins:
  n\k 1    2     3      4       5        6        7        8        9      10
  1:  1
  2:  1    2
  3:  1    6     6
  4:  1   14    36     24
  5:  1   30   150    240     120
  6:  1   62   540   1560    1800      720
  7:  1  126  1806   8400   16800    15120     5040
  8:  1  254  5796  40824  126000   191520   141120    40320
  9:  1  510 18150 186480  834120  1905120  2328480  1451520   362880
  10: 1 1022 55980 818520 5103000 16435440 29635200 30240000 16329600 3628800
  ... Reformatted and extended - _Wolfdieter Lang_, Oct 04 2014
---------------------------------------------------------------------------
T(4,1) = 1: {1234}. T(4,2) = 14: {1}{234} (4 ways), {12}{34} (6 ways), {123}{4} (4 ways). T(4,3) = 36: {12}{3}{4} (12 ways), {1}{23}{4} (12 ways), {1}{2}{34} (12 ways). T(4,4) = 1: {1}{2}{3}{4} (1 way).
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 89, ex. 1; also p. 210.
  • Miklos Bona, Combinatorics of Permutations, Chapman and Hall,2004, p.12.
  • G. Boole, A Treatise On The Calculus of Finite Differences, Dover Publications, 1960, p. 20.
  • H. T. Davis, Tables of the Mathematical Functions. Vols. 1 and 2, 2nd ed., 1963, Vol. 3 (with V. J. Fisher), 1962; Principia Press of Trinity Univ., San Antonio, TX, Vol. 2, p. 212.
  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, 1989, p. 155. Also eqs.(6.10) and (6.37).
  • Kiran S. Kedlaya and Andrew V. Sutherland, Computing L -Series of Hyperelliptic Curves in Algorithmic Number Theory Lecture Notes in Computer Science Volume 5011/2008.
  • T. K. Petersen, Eulerian Numbers, Birkhauser, 2015, Section 5.6.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 33.
  • J. F. Steffensen, Interpolation, 2nd ed., Chelsea, NY, 1950, see p. 54.
  • A. H. Voigt, Theorie der Zahlenreihen und der Reihengleichungen, Goschen, Leipzig, 1911, p. 31.
  • E. Whittaker and G. Robinson, The Calculus of Observations, Blackie, London, 4th ed., 1949; p. 7.

Crossrefs

Row sums give A000670. Maximal terms in rows give A002869. Central terms T(2k-1,k) give A233734.
Diagonal is n! (A000142). 2nd diagonal is A001286. 3rd diagonal is A037960.
Reflected version of A090582. A371568 is another version.
See also the two closely related triangles: A008277(n, k) = T(n, k)/k! (Stirling numbers of second kind) and A028246(n, k) = T(n, k)/k.
Cf. A033282 'faces' of the associahedron.
Cf. A008292, A047969, A145901, A145902. - Peter Bala, Oct 26 2008
Visible in the 3-D array in A249042.
See also A000182.

Programs

  • Haskell
    a019538 n k = a019538_tabl !! (n-1) !! (k-1)
    a019538_row n = a019538_tabl !! (n-1)
    a019538_tabl = iterate f [1] where
       f xs = zipWith (*) [1..] $ zipWith (+) ([0] ++ xs) (xs ++ [0])
    -- Reinhard Zumkeller, Dec 15 2013
    
  • Maple
    with(combinat): A019538 := (n,k)->k!*stirling2(n,k);
  • Mathematica
    Table[k! StirlingS2[n, k], {n, 9}, {k, n}] // Flatten
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, sum(i=0, k, (-1)^i * binomial(k, i) * (k-i)^n))}; /* Michael Somos, Oct 08 2003 */
    
  • Sage
    def T(n, k): return factorial(k)*stirling_number2(n,k) # Danny Rorabaugh, Oct 10 2015

Formula

T(n, k) = k*(T(n-1, k-1)+T(n-1, k)) with T(0, 0) = 1 [or T(1, 1) = 1]. - Henry Bottomley, Mar 02 2001
E.g.f.: (y*(exp(x)-1) - exp(x))/(y*(exp(x)-1) - 1). - Vladeta Jovovic, Jan 30 2003
Equals [0, 1, 0, 2, 0, 3, 0, 4, 0, 5, ...] DELTA [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, ...] where DELTA is Deléham's operator defined in A084938.
T(n, k) = Sum_{j=0..k} (-1)^(k-j)*j^n*binomial(k, j). - Mario Catalani (mario.catalani(AT)unito.it), Nov 28 2003. See Graham et al., eq. (6.19), p. 251. For a proof see Bert Seghers, Jun 29 2013.
Sum_{k=0..n} T(n, k)(-1)^(n-k) = 1, Sum_{k=0..n} T(n, k)(-1)^k = (-1)^n. - Mario Catalani (mario.catalani(AT)unito.it), Dec 11 2003
O.g.f. for n-th row: polylog(-n, x/(1+x))/(x+x^2). - Vladeta Jovovic, Jan 30 2005
E.g.f.: 1 / (1 + t*(1-exp(x))). - Tom Copeland, Oct 13 2008
From Peter Bala, Oct 26 2008: (Start)
O.g.f. as a continued fraction: 1/(1 - x*t/(1 - (x + 1)*t/(1 - 2*x*t/(1 - 2*(x + 1)*t/(1 - ...))))) = 1 + x*t + (x + 2*x^2)*t^2 + (x + 6*x^2 + 6*x^3)*t^3 + ... .
The row polynomials R(n,x), which begin R(1,x) = x, R(2,x) = x + 2*x^2, R(3,x) = x + 6*x^2 + 6*x^3, satisfy the recurrence x*d/dx ((x + 1)*R(n,x)) = R(n+1,x). It follows that the zeros of R(n,x) are real and negative (apply Corollary 1.2 of [Liu and Wang]).
Since this is the triangle of f-vectors of the (simplicial complexes dual to the) type A permutohedra, whose h-vectors form the Eulerian number triangle A008292, the coefficients of the polynomial (x-1)^n*R(n,1/(x-1)) give the n-th row of A008292. For example, from row 3 we have x^2 + 6*x + 6 = 1 + 4*y + y^2, where y = x + 1, producing [1,4,1] as the third row of A008292. The matrix product A008292 * A007318 gives the mirror image of this triangle (see A090582).
For n,k >= 0, T(n+1,k+1) = Sum_{j=0..k} (-1)^(k-j)*binomial(k,j)*[(j+1)^(n+1) - j^(n+1)]. The matrix product of Pascal's triangle A007318 with the current array gives (essentially) A047969. This triangle is also related to triangle A047969 by means of the S-transform of [Hetyei], a linear transformation of polynomials whose value on the basis monomials x^k is given by S(x^k) = binomial(x,k). The S-transform of the shifted n-th row polynomial Q(n,x) := R(n,x)/x is S(Q(n,x)) = (x+1)^n - x^n. For example, from row 3 we obtain S(1 + 6*x + 6*x^2) = 1 + 6*x + 6*x*(x-1)/2 = 1 + 3*x + 3*x^2 = (x+1)^3 - x^3. For fixed k, the values S(Q(n,k)) give the nonzero entries in column (k-1) of the triangle A047969 (the Hilbert transform of the Eulerian numbers). (End)
E.g.f.: (exp(x)-1)^k = sum T(n,k)x^n/n!. - Vladimir Kruchinin, Aug 10 2010
T(n,k) = Sum_{i=1..k} A(n,i)*Binomial(n-i,k-i) where A(n,i) is the number of n-permutations that have i ascending runs, A008292.
From Tom Copeland, Oct 11 2011: (Start)
With e.g.f. A(x,t) = -1 + 1/(1+t*(1-exp(x))), the comp. inverse in x is B(x,t) = log(((1+t)/t) - 1/(t(1+x))).
With h(x,t) = 1/(dB/dx)= (1+x)((1+t)(1+x)-1), the row polynomial P(n,t) is given by (h(x,t)*d/dx)^n x, eval. at x=0, A=exp(x*h(y,t)*d/dy) y, eval. at y=0, and dA/dx = h(A(x,t),t), with P(0,t)=0.
(A factor of -1/n! was removed by Copeland on Aug 25 2016.) (End)
The term linear in x of [x*h(d/dx,t)]^n 1 gives the n-th row polynomial. (See A134685.) - Tom Copeland, Nov 07 2011
Row polynomials are given by D^n(1/(1-x*t)) evaluated at x = 0, where D is the operator (1+x)*d/dx. - Peter Bala, Nov 25 2011
T(n,x+y) = Sum_{j=0..n} binomial(n,j)*T(j,x)*T(n-j,y). - Dennis P. Walsh, Feb 24 2012
Let P be a Rota-Baxter operator of weight 1 satisfying the identity P(x)*P(y) = P(P(x)*y) + P(x*P(y)) + P(x*y). Then P(1)^2 = P(1) + 2*P^2(1). More generally, Guo shows that P(1)^n = Sum_{k=1..n} T(n,k)*P^k(1). - Peter Bala, Jun 08 2012
Sum_{i=1..n} (-1)^i*T(n,i)/i = 0, for n > 1. - Leonid Bedratyuk, Aug 09 2012
T(n, k) = Sum_{j=0..k} (-1)^j*binomial(k, j)*(k-j)^n. [M. Catalani's re-indexed formula from Nov 28 2003] Proof: count the surjections of [n] onto [k] with the inclusion-exclusion principle, as an alternating sum of the number of functions from [n] to [k-j]. - Bert Seghers, Jun 29 2013
n-th row polynomial = 1/(1 + x)*( Sum_{k>=0} k^n*(x/(1 + x))^k ), valid for x in the open interval (-1/2, inf). See Tanny link. Cf. A145901. - Peter Bala, Jul 22 2014
T(n,k) = k * A141618(n,k-1) / binomial(n,k-1). - Tom Copeland, Oct 25 2014
Sum_{n>=0} n^k*a^n = Sum_{i=1..k} (a / (1 - a))^i * T(k, i)/(1-a) for |a| < 1. - David A. Corneth, Mar 09 2015
From Peter Bala, May 26 2015: (Start)
The row polynomials R(n,x) satisfy (1 + x)*R(n,x) = (-1)^n*x*R(n,-(1 + x)).
For a fixed integer k, the expansion of the function A(k,z) := exp( Sum_{n >= 1} R(n,k)*z^n/n ) has integer coefficients and satisfies the functional equation A(k,z)^(k + 1) = BINOMIAL(A(k,z))^k, where BINOMIAL(F(z))= 1/(1 - z)*F(z/(1 - z)) denotes the binomial transform of the o.g.f. F(z). Cf. A145901. For cases see A084784 (k = 1), A090352 (k = 2), A090355 (k = 3), A090357 (k = 4), A090362 (k = 5) and A084785 (k = -2 with z -> -z).
A(k,z)^(k + 1) = A(-(k + 1),-z)^k and hence BINOMIAL(A(k,z)) = A(-(k + 1),-z). (End)
From Tom Copeland, Oct 19 2016: (Start)
Let a(1) = 1 + x + B(1) = x + 1/2 and a(n) = B(n) = (B.)^n, where B(n) are the Bernoulli numbers defined by e^(B.t) = t / (e^t-1), then t / e^(a.t) = t / [(x + 1) * t + exp(B.t)] = (e^t - 1) /[ 1 + (x + 1) (e^t - 1)] = exp(p.(x)t), where (p.(x))^n = p_n(x) are the shifted, signed row polynomials of this array: p_0(x) = 0, p_1(x) = 1, p_2(x) = -(1 + 2 x), p_3(x) = 1 + 6 x + 6 x^2, ... and p_n(x) = n * b(n-1), where b(n) are the partition polynomials of A133314 evaluated with these a(n).
Sum_{n > 0} R(n,-1/2) x^n/n! = 2 * tanh(x/2), where R(n,x) = Sum_{k = 1..n} T(n,k) x^(k-1) are the shifted row polynomials of this entry, so R(n,-1/2) = 4 * (2^(n+1)-1) B(n+1)/(n+1). (Cf. A000182.)
(End)
Also the Bernoulli numbers are given by B(n) = Sum_{k =1..n} (-1)^k T(n,k) / (k+1). - Tom Copeland, Nov 06 2016
G.f. for column k: k! x^k / Product_{i=1..k} (1-i*x). - Robert A. Russell, Sep 25 2018
a(j) <= A183109(j). - Manfred Boergens, Jul 25 2021

A001047 a(n) = 3^n - 2^n.

Original entry on oeis.org

0, 1, 5, 19, 65, 211, 665, 2059, 6305, 19171, 58025, 175099, 527345, 1586131, 4766585, 14316139, 42981185, 129009091, 387158345, 1161737179, 3485735825, 10458256051, 31376865305, 94134790219, 282412759265, 847255055011, 2541798719465, 7625463267259, 22876524019505
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the sum of the elements in the n-th row of triangle pertaining to A036561. - Amarnath Murthy, Jan 02 2002
Number of 2 X n binary arrays with a path of adjacent 1's and no path of adjacent 0's from top row to bottom row. - R. H. Hardin, Mar 21 2002
With offset 1, partial sums of A027649. - Paul Barry, Jun 24 2003
Number of distinct lines through the origin in the n-dimensional lattice of side length 2. A049691 has the values for the 2-dimensional lattice of side length n. - Joshua Zucker, Nov 19 2003
a(n+1)/(n+1)=(3*3^n-2*2^n)/(n+1) is the second binomial transform of the harmonic sequence 1/(n+1). - Paul Barry, Apr 19 2005
a(n+1) is the sum of n-th row of A036561. - Reinhard Zumkeller, May 14 2006
The sequence gives the sum of the lengths of the segments in Cantor's dust generating sequence up to the i-th step. Measurement unit = length of the segment of i-th step. - Giorgio Balzarotti, Nov 18 2006
Let T 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), xTy if x is a proper subset of y. Then a(n) = |T|. - Ross La Haye, Dec 22 2006
From Alexander Adamchuk, Jan 04 2007: (Start)
a(n) is prime for n in A057468.
p divides a(p) - 1 for prime p.
Quotients (3^p - 2^p - 1)/p, where p = prime(n), are listed in A127071.
Numbers k such that k divides 3^k - 2^k - 1 are listed in A127072.
Pseudoprimes in A127072(n) include all powers of primes {2,3,7} and some composite numbers that are listed in A127073, which includes all Carmichael numbers A002997.
Numbers n such that n^2 divides 3^n - 2^n - 1 are listed in A127074.
5 divides a(2n).
5^2 divides a(2*5n).
5^3 divides a(2*5^2n).
5^4 divides a(2*5^3n).
7^2 divides a(6*7n).
13 divides a(4n).
13^2 divides a(4*13n).
19 divides a(3n).
19^2 divides a(3*19n).
23^2 divides a(11n).
23^3 divides a(11*23n).
23^4 divides a(11*23^2n).
29 divides a(7n).
p divides a((p-1)n) for prime p>3.
p divides a((p-1)/2) for prime p in A097934. Also primes p such that 6 is a square mod p, except {2,3}, A038876(n).
p^(k+1) divides a(p^k*(p-1)/2*n) for prime p in A097934.
p^(k+1) divides a(p^k*(p-1)*n) for prime p>3.
Note the exception that for p = 23, p^(k+2) divides a(p^k*(p-1)/2*n).
There are no more such exceptions for primes p up to 600000. (End)
a(n) divides a(q*(n+1)-1), for all q integer. Leonardo Sarasua, Apr 15 2024
Final digits of terms follow sequence 1,5,9,5. - Enoch Haga, Nov 26 2007
This is also the second column sequence of the Sheffer triangle A143494 (2-restricted Stirling2 numbers). See the e.g.f. given below. - Wolfdieter Lang, Oct 08 2011
Partial sums give A000392. - Jon Perry, Apr 05 2014
For n >= 1, this is also row 2 of A281890: when consecutive positive integers are written as a product of primes in nondecreasing order, "3" occurs in n-th position a(n) times out of every 6^n. - Peter Munn, May 17 2017
a(n) is the number of ternary sequences of length n which include the digit 2. For example, a(2)=5 since the sequences are 02,20,12,21,22. - Enrique Navarrete, Apr 05 2021
a(n-1) is the number of ways we can form disjoint unions of two nonempty subsets of [n] such that the union contains n. For example, for n = 3, a(2) = 5 since the disjoint unions are {1}U{3}, {1}U{2,3}, {2}U{3}, {2}U{1,3}, and {1,2}U{3}. Cf. A000392 if we drop the requirement that the union contains n. - Enrique Navarrete, Aug 24 2021
Configures as a composite Koch Snowflake Fractal (see illustration in links) based on the five-fold division of the Cantor Square/Cantor Dust Fractal of (9^n-4^n)/5 see my illustration in (A016153). - John Elias, Oct 13 2021
Number of pairs (A,B) where B is a subset of {1,2,...,n} and A is a proper subset of B. - Jianing Song, Jun 18 2022
From Manfred Boergens, Mar 29 2023: (Start)
With regard to the comments by Ross La Haye and Jianing Song: Omitting "proper" gives A000244.
Number of pairs (A,B) where B is a nonempty subset of {1,2,...,n} and A is a nonempty subset of B. For nonempty proper subsets see a(n+1) in A028243. (End)
a(n) is the number of n-digit numbers whose smallest decimal digit is 7. - Stefano Spezia, Nov 15 2023
a(n-1) is the number of all possible player-reduced binary games observed by each player in an nx2 game assuming the individual strategies of k < n - 1 players are fixed and the remaining n - k - 1 player will play as one, either maintaining their status quo strategies or jointly adopting an alternative strategy. - Ambrosio Valencia-Romero, Apr 11 2024

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 86-87.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = row sums of A091913, row 2 of A047969, column 1 of A090888 and column 1 of A038719.
Cf. partitions: A241766, A241759.
A diagonal of A262307.

Programs

  • Haskell
    a001047 n = a001047_list !! n
    a001047_list = map fst $ iterate (\(u, v) -> (3 * u + v, 2 * v)) (0, 1)
    -- Reinhard Zumkeller, Jun 09 2013
  • Magma
    [3^n - 2^n: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    seq(3^n - 2^n, n=0..40); # Giorgio Balzarotti, Nov 18 2006
    A001047:=1/(3*z-1)/(2*z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[ 3^n - 2^n, {n, 0, 25} ]
    LinearRecurrence[{5, -6}, {0, 1}, 25] (* Harvey P. Dale, Aug 18 2011 *)
    Numerator@NestList[(3#+1)/2&,1/2,100] (* Zak Seidov, Oct 03 2011 *)
  • PARI
    {a(n) = 3^n - 2^n};
    
  • Python
    [3**n - 2**n for n in range(25)] # Ross La Haye, Aug 19 2005; corrected by David Radcliffe, Jun 26 2016
    
  • Sage
    [lucas_number1(n, 5, 6) for n in range(26)]  # Zerinvary Lajos, Apr 22 2009
    

Formula

G.f.: x/((1-2*x)*(1-3*x)).
a(n) = 5*a(n-1) - 6*a(n-2).
a(n) = 3*a(n-1) + 2^(n-1). - Jon Perry, Aug 23 2002
Starting 0, 0, 1, 5, 19, ... this is 3^n/3 - 2^n/2 + 0^n/6, the binomial transform of A086218. - Paul Barry, Aug 18 2003
a(n) = A083323(n)-1 = A056182(n)/2 = (A002783(n)-1)/2 = (A003063(n+2)-A003063(n+1))/2. - Ralf Stephan, Jan 12 2004
Binomial transform of A000225. - Ross La Haye, Feb 07 2005
a(n) = Sum_{k=0..n-1} binomial(n, k)*2^k. - Ross La Haye, Aug 20 2005
a(n) = 2^(2n) - A083324(n). - Ross La Haye, Sep 10 2005
a(n) = A112626(n, 1). - Ross La Haye, Jan 11 2006
E.g.f.: exp(3*x) - exp(2*x). - Mohammad K. Azarian, Jan 14 2009
a(n) = A217764(n,1). - Ross La Haye, Mar 27 2013
a(n) = 2*a(n-1) + 3^(n-1). - Toby Gottfried, Mar 28 2013
a(n) = A000244(n) - A000079(n). - Omar E. Pol, Mar 28 2013
a(n) = Sum_{k=0..2} Stirling1(2,k)*(k+1)^n = c_2^{(-n)}, poly-Cauchy numbers. - Takao Komatsu, Mar 28 2013
a(n) = A227048(n,A098294(n)). - Reinhard Zumkeller, Jun 30 2013
a(n+1) = Sum_{k=0..n} 2^k*3^(n-k). - J. M. Bergot, Mar 27 2018
Sum_{n>=1} 1/a(n) = A329064. - Amiram Eldar, Nov 20 2020
a(n) = (1/2)*Sum_{k=0..n} binomial(n, k)*(2^(n-k) + 2^k - 2).
a(n) = A001117(n) + 2*A000918(n) + 1. - Ambrosio Valencia-Romero, Mar 08 2022
a(n) = A000225(n) + A028243(n+1). - Ambrosio Valencia-Romero, Mar 09 2022
From Peter Bala, Jun 27 2025: (Start)
exp(Sum_{n >=1} a(2*n)/a(n)*x^n/n) = Sum_{n >= 0} a(n+1)*x^n.
exp(Sum_{n >=1} a(3*n)/a(n)*x^n/n) = 1 + 19*x + 247*x^2 + ... is the g.f. of A019443.
exp(Sum_{n >=1} a(4*n)/a(n)*x^n/n) = 1 + 65*x + 2743*x^2 + ... is the g.f. of A383754.
The following are all examples of telescoping series:
Sum_{n >= 1} 6^n/(a(n)*a(n+1)) = 2, since 6^n/(a(n)*a(n+1)) = b(n) - b(n+1), where b(n) = 2^n/a(n);
Sum_{n >= 1} 18^n/(a(n)*a(n+1)*a(n+2)) = 22/75, since 18^n/(a(n)*a(n+1)*a(n+2)) = c(n) - c(n+1), where c(n) = (5*6^n - 2*4^n)/(15*a(n)*a(n+1));
Sum_{n >= 1} 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = 634/48735 since 54^n/(a(n)*a(n+1)*a(n+2)*a(n+3)) = d(n) - d(n+1), where d(n) = (57*18^n - 38*12^n + 8*8^n)/(513*a(n)*a(n+1)*a(n+2)).
Sum_{n >= 1} 6^n/(a(n)*a(n+2)) = 14/25; Sum_{n >= 1} (-6)^n/(a(n)*a(n+2)) = -6/25.
Sum_{n >= 1} 6^n/(a(n)*a(n+3)) = 306/1805.
Sum_{n >= 1} 6^n/(a(n)*a(n+4)) = 4282/80275; Sum_{n >= 1} (-6)^n/(a(n)*a(n+4)) = -1698/80275. (End)

Extensions

Edited by Charles R Greathouse IV, Mar 24 2010

A027383 a(2*n) = 3*2^n - 2; a(2*n+1) = 2^(n+2) - 2.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 22, 30, 46, 62, 94, 126, 190, 254, 382, 510, 766, 1022, 1534, 2046, 3070, 4094, 6142, 8190, 12286, 16382, 24574, 32766, 49150, 65534, 98302, 131070, 196606, 262142, 393214, 524286, 786430, 1048574, 1572862, 2097150, 3145726, 4194302, 6291454
Offset: 0

Views

Author

Keywords

Comments

Number of balanced strings of length n: let d(S) = #(1's) - #(0's), # == count in S, then S is balanced if every substring T of S has -2 <= d(T) <= 2.
Number of "fold lines" seen when a rectangular piece of paper is folded n+1 times along alternate orthogonal directions and then unfolded. - Quim Castellsaguer (qcastell(AT)pie.xtec.es), Dec 30 1999
Also the number of binary strings with the property that, when scanning from left to right, once the first 1 is seen in position j, there must be a 1 in positions j+2, j+4, ... until the end of the string. (Positions j+1, j+3, ... can be occupied by 0 or 1.) - Jeffrey Shallit, Sep 02 2002
a(n-1) is also the Moore lower bound on the order of a (3,n)-cage. - Eric W. Weisstein, May 20 2003 and Jason Kimberley, Oct 30 2011
Partial sums of A016116. - Hieronymus Fischer, Sep 15 2007
Equals row sums of triangle A152201. - Gary W. Adamson, Nov 29 2008
From John P. McSorley, Sep 28 2010: (Start)
a(n) = DPE(n+1) is the total number of k-double-palindromes of n up to cyclic equivalence. See sequence A180918 for the definitions of a k-double-palindrome of n and of cyclic equivalence. Sequence A180918 is the 'DPE(n,k)' triangle read by rows where DPE(n,k) is the number of k-double-palindromes of n up to cyclic equivalence. For example, we have a(4) = DPE(5) = DPE(5,1) + DPE(5,2) + DPE(5,3) + DPE(5,4) + DPE(5,5) = 0 + 2 + 2 + 1 + 1 = 6.
The 6 double-palindromes of 5 up to cyclic equivalence are 14, 23, 113, 122, 1112, 11111. They come from cyclic equivalence classes {14,41}, {23,32}, {113,311,131}, {122,212,221}, {1112,2111,1211,1121}, and {11111}. Hence a(n)=DPE(n+1) is the total number of cyclic equivalence classes of n containing at least one double-palindrome.
(End)
From Herbert Eberle, Oct 02 2015: (Start)
For n > 0, there is a red-black tree of height n with a(n-1) internal nodes and none with less.
In order a red-black tree of given height has minimal number of nodes, it has exactly 1 path with strictly alternating red and black nodes. All nodes outside this height defining path are black.
Consider:
mrbt5 R
/ \
/ \
/ \
/ B
/ / \
mrbt4 B / B
/ \ B E E
/ B E E
mrbt3 R E E
/ \
/ B
mrbt2 B E E
/ E
mrbt1 R
E E
(Red nodes shown as R, blacks as B, externals as E.)
Red-black trees mrbt1, mrbt2, mrbt3, mrbt4, mrbt5 of respective heights h = 1, 2, 3, 4, 5; all minimal in the number of internal nodes, namely 1, 2, 4, 6, 10.
Recursion (let n = h-1): a(-1) = 0, a(n) = a(n-1) + 2^floor(n/2), n >= 0.
(End)
Also the number of strings of length n with the digits 1 and 2 with the property that the sum of the digits of all substrings of uneven length is not divisible by 3. An example with length 8 is 21221121. - Herbert Kociemba, Apr 29 2017
a(n-2) is the number of achiral n-bead necklaces or bracelets using exactly two colors. For n=4, the four arrangements are AAAB, AABB, ABAB, and ABBB. - Robert A. Russell, Sep 26 2018
Partial sums of powers of 2 repeated 2 times, like A200672 where is 3 times. - Yuchun Ji, Nov 16 2018
Also the number of binary words of length n with cuts-resistance <= 2, where, for the operation of shortening all runs by one, cuts-resistance is the number of applications required to reach an empty word. Explicitly, these are words whose sequence of run-lengths, all of which are 1 or 2, has no odd-length run of 1's sandwiched between two 2's. - Gus Wiseman, Nov 28 2019
Also the number of up-down paths with n steps such that the height difference between the highest and lowest points is at most 2. - Jeremy Dover, Jun 17 2020
Also the number of non-singleton integer compositions of n + 2 with no odd part other than the first or last. Including singletons gives A052955. This is an unsorted (or ordered) version of A351003. The version without even (instead of odd) interior parts is A001911, complement A232580. Note that A000045(n-1) counts compositions without odd parts, with non-singleton case A077896, and A052952/A074331 count non-singleton compositions without even parts. Also the number of compositions y of n + 1 such that y_i = y_{i+1} for all even i. - Gus Wiseman, Feb 19 2022

Examples

			After 3 folds one sees 4 fold lines.
Example: a(3) = 6 because the strings 001, 010, 100, 011, 101, 110 have the property.
Binary: 1, 10, 100, 110, 1010, 1110, 10110, 11110, 101110, 111110, 1011110, 1111110, 10111110, 11111110, 101111110, 111111110, 1011111110, 1111111110, 10111111110, ... - _Jason Kimberley_, Nov 02 2011
Example: Partial sums of powers of 2 repeated 2 times:
a(3) = 1+1+2 = 4;
a(4) = 1+1+2+2 = 6;
a(5) = 1+1+2+2+4 = 10.
_Yuchun Ji_, Nov 16 2018
		

References

  • John P. McSorley: Counting k-compositions of n with palindromic and related structures. Preprint, 2010. [John P. McSorley, Sep 28 2010]

Crossrefs

Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), this sequence (k=3), A062318 (k=4), A061547 (k=5), A198306 (k=6), A198307 (k=7), A198308 (k=8), A198309 (k=9), A198310 (k=10), A094626 (k=11); columns: A020725 (g=3), A005843 (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A000066 (actual order of a (3,g)-cage).
Bisections are A033484 (even) and A000918 (odd).
a(n) = A305540(n+2,2), the second column of the triangle.
Numbers whose binary expansion is a balanced word are A330029.
Binary words counted by cuts-resistance are A319421 or A329860.
The complementary compositions are counted by A274230(n-1) + 1, with bisections A060867 (even) and A134057 (odd).
Cf. A000346, A000984, A001405, A001700, A011782 (compositions).
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - N. J. A. Sloane, Jul 14 2022

Programs

  • Haskell
    import Data.List (transpose)
    a027383 n = a027383_list !! n
    a027383_list = concat $ transpose [a033484_list, drop 2 a000918_list]
    -- Reinhard Zumkeller, Jun 17 2015
    
  • Magma
    [2^Floor((n+2)/2)+2^Floor((n+1)/2)-2: n in [0..50]]; // Vincenzo Librandi, Aug 16 2011
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=2*a[n-2]+2 od: seq(a[n], n=1..41); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    a[n_?EvenQ] := 3*2^(n/2)-2; a[n_?OddQ] := 2^(2+(n-1)/2)-2; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 21 2011, after Quim Castellsaguer *)
    LinearRecurrence[{1, 2, -2}, {1, 2, 4}, 41] (* Robert G. Wilson v, Oct 06 2014 *)
    Table[Length[Select[Tuples[{0,1},n],And[Max@@Length/@Split[#]<=2,!MatchQ[Length/@Split[#],{_,2,ins:1..,2,_}/;OddQ[Plus[ins]]]]&]],{n,0,15}] (* Gus Wiseman, Nov 28 2019 *)
  • PARI
    a(n)=2^(n\2+1)+2^((n+1)\2)-2 \\ Charles R Greathouse IV, Oct 21 2011
    
  • Python
    def a(n): return 2**((n+2)//2) + 2**((n+1)//2) - 2
    print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 19 2022

Formula

a(0)=1, a(1)=2; thereafter a(n+2) = 2*a(n) + 2.
a(2n) = 3*2^n - 2 = A033484(n);
a(2n-1) = 2^(n+1) - 2 = A000918(n+1).
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = Sum_{k=0..n} 2^min(k, n-k).
a(n) = 2^floor((n+2)/2) + 2^floor((n+1)/2) - 2. - Quim Castellsaguer (qcastell(AT)pie.xtec.es)
a(n) = 2^(n/2)*(3 + 2*sqrt(2) + (3-2*sqrt(2))*(-1)^n)/2 - 2. - Paul Barry, Apr 23 2004
a(n) = A132340(A052955(n)). - Reinhard Zumkeller, Aug 20 2007
a(n) = A052955(n+1) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n+1)) - 1. - Hieronymus Fischer, Sep 15 2007
a(n) = A132666(a(n-1)+1) for n > 0. - Hieronymus Fischer, Sep 15 2007
A132666(a(n)) = a(n-1) + 1 for n > 0. - Hieronymus Fischer, Sep 15 2007
G.f.: (1 + x)/((1 - x)*(1 - 2*x^2)). - David Callan, Jul 22 2008
a(n) = 2*( (a(n-2)+1) mod (a(n-1)+1) ), n > 1. - Pierre Charland, Dec 12 2010
a(n) = A136252(n-1) + 1, for n > 0. - Jason Kimberley, Nov 01 2011
G.f.: (1+x*R(0))/(1-x), where R(k) = 1 + 2*x/( 1 - x/(x + 1/R(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 2^((2*n + 3*(1-(-1)^n))/4)*3^((1+(-1)^n)/2) - 2. - Luce ETIENNE, Sep 01 2014
a(n) = a(n-1) + 2^floor((n-1)/2) for n>0, a(0)=1. - Yuchun Ji, Nov 23 2018
E.g.f.: 3*cosh(sqrt(2)*x) - 2*cosh(x) + 2*sqrt(2)*sinh(sqrt(2)*x) - 2*sinh(x). - Stefano Spezia, Apr 06 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 24 2000
Replaced definition with a simpler one. - N. J. A. Sloane, Jul 09 2022

A260443 Prime factorization representation of Stern polynomials: a(0) = 1, a(1) = 2, a(2n) = A003961(a(n)), a(2n+1) = a(n)*a(n+1).

Original entry on oeis.org

1, 2, 3, 6, 5, 18, 15, 30, 7, 90, 75, 270, 35, 450, 105, 210, 11, 630, 525, 6750, 245, 20250, 2625, 9450, 77, 15750, 3675, 47250, 385, 22050, 1155, 2310, 13, 6930, 5775, 330750, 2695, 3543750, 128625, 1653750, 847, 4961250, 643125, 53156250, 18865, 24806250, 202125, 727650, 143, 1212750, 282975, 57881250, 29645, 173643750, 1414875, 18191250, 1001
Offset: 0

Views

Author

Antti Karttunen, Jul 28 2015

Keywords

Comments

The exponents in the prime factorization of term a(n) give the coefficients of the n-th Stern polynomial. See A125184 and the examples.
None of the terms have prime gaps in their factorization, i.e., all can be found in A073491.
Contains neither perfect squares nor prime powers with exponent > 1. A277701 gives the positions of the terms that are 2*square. - Antti Karttunen, Oct 27 2016
Many of the derived sequences (like A002487) have similar "Fir forest" or "Gaudian cathedrals" style scatter plot. - Antti Karttunen, Mar 21 2017

Examples

			n    a(n)   prime factorization    Stern polynomial
------------------------------------------------------------
0       1   (empty)                B_0(x) = 0
1       2   p_1                    B_1(x) = 1
2       3   p_2                    B_2(x) = x
3       6   p_2 * p_1              B_3(x) = x + 1
4       5   p_3                    B_4(x) = x^2
5      18   p_2^2 * p_1            B_5(x) = 2x + 1
6      15   p_3 * p_2              B_6(x) = x^2 + x
7      30   p_3 * p_2 * p_1        B_7(x) = x^2 + x + 1
8       7   p_4                    B_8(x) = x^3
9      90   p_3 * p_2^2 * p_1      B_9(x) = x^2 + 2x + 1
		

Crossrefs

Same sequence sorted into ascending order: A260442.
Cf. also A048675, A277333 (left inverses).
Cf. A277323, A277324 (bisections), A277200 (even terms sorted), A277197 (first differences), A277198.
Cf. A277316 (values at primes), A277318.
Cf. A023758 (positions of squarefree terms), A101082 (of terms not squarefree), A277702 (positions of records), A277703 (their values).
Cf. A283992, A283993 (number of irreducible, reducible polynomials in range 1 .. n).
Cf. also A206296 (Fibonacci polynomials similarly represented).

Programs

  • Maple
    b:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]):
    a:= proc(n) option remember; `if`(n<2, n+1,
          `if`(irem(n, 2, 'h')=0, b(a(h)), a(h)*a(n-h)))
        end:
    seq(a(n), n=0..56);  # Alois P. Heinz, Jul 04 2024
  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[a@ n, {n, 0, 56}] (* Michael De Vlieger, Apr 05 2017 *)
  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2)))); \\ After Charles R Greathouse IV's code for "ps" in A186891.
    \\ Antti Karttunen, Oct 11 2016
    
  • Python
    from sympy import factorint, prime, primepi
    from functools import reduce
    from operator import mul
    def a003961(n):
        F = factorint(n)
        return 1 if n==1 else reduce(mul, (prime(primepi(i) + 1)**F[i] for i in F))
    def a(n): return n + 1 if n<2 else a003961(a(n//2)) if n%2==0 else a((n - 1)//2)*a((n + 1)//2)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017
  • Scheme
    ;; Uses memoization-macro definec:
    (definec (A260443 n) (cond ((<= n 1) (+ 1 n)) ((even? n) (A003961 (A260443 (/ n 2)))) (else (* (A260443 (/ (- n 1) 2)) (A260443 (/ (+ n 1) 2))))))
    ;; A more standalone version added Oct 10 2016, requiring only an implementation of A000040 and the memoization-macro definec:
    (define (A260443 n) (product_primes_to_kth_powers (A260443as_coeff_list n)))
    (define (product_primes_to_kth_powers nums) (let loop ((p 1) (nums nums) (i 1)) (cond ((null? nums) p) (else (loop (* p (expt (A000040 i) (car nums))) (cdr nums) (+ 1 i))))))
    (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    

Formula

a(0) = 1, a(1) = 2, a(2n) = A003961(a(n)), a(2n+1) = a(n)*a(n+1).
Other identities. For all n >= 0:
A001221(a(n)) = A277314(n). [#nonzero coefficients in each polynomial.]
A001222(a(n)) = A002487(n). [When each polynomial is evaluated at x=1.]
A048675(a(n)) = n. [at x=2.]
A090880(a(n)) = A178590(n). [at x=3.]
A248663(a(n)) = A264977(n). [at x=2 over the field GF(2).]
A276075(a(n)) = A276081(n). ["at factorials".]
A156552(a(n)) = A277020(n). [Converted to "unary-binary" encoding.]
A051903(a(n)) = A277315(n). [Maximal coefficient.]
A277322(a(n)) = A277013(n). [Number of irreducible polynomial factors.]
A005361(a(n)) = A277325(n). [Product of nonzero coefficients.]
A072411(a(n)) = A277326(n). [And their LCM.]
A007913(a(n)) = A277330(n). [The squarefree part.]
A000005(a(n)) = A277705(n). [Number of divisors.]
A046523(a(n)) = A278243(n). [Filter-sequence.]
A284010(a(n)) = A284011(n). [True for n > 1. Another filter-sequence.]
A003415(a(n)) = A278544(n). [Arithmetic derivative.]
A056239(a(n)) = A278530(n). [Weighted sum of coefficients.]
A097249(a(n)) = A277899(n).
a(A000079(n)) = A000040(n+1).
a(A000225(n)) = A002110(n).
a(A000051(n)) = 3*A002110(n).
For n >= 1, a(A000918(n)) = A070826(n).
A007949(a(n)) is the interleaving of A000035 and A005811, probably A101979.
A061395(a(n)) = A277329(n).
Also, for all n >= 1:
A055396(a(n)) = A001511(n).
A252735(a(n)) = A061395(a(n)) - 1 = A057526(n).
a(A000040(n)) = A277316(n).
a(A186891(1+n)) = A277318(n). [Subsequence for irreducible polynomials].

Extensions

More linking formulas added by Antti Karttunen, Mar 21 2017

A131689 Triangle of numbers T(n,k) = k!*Stirling2(n,k) = A000142(k)*A048993(n,k) read by rows, T(n, k) for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 6, 6, 0, 1, 14, 36, 24, 0, 1, 30, 150, 240, 120, 0, 1, 62, 540, 1560, 1800, 720, 0, 1, 126, 1806, 8400, 16800, 15120, 5040, 0, 1, 254, 5796, 40824, 126000, 191520, 141120, 40320, 0, 1, 510, 18150, 186480, 834120, 1905120, 2328480, 1451520, 362880
Offset: 0

Views

Author

Philippe Deléham, Sep 14 2007

Keywords

Comments

Triangle T(n,k), 0 <= k <= n, read by rows given by [0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,...] DELTA [1,1,2,2,3,3,4,4,5,5,6,6,...] where DELTA is the operator defined in A084938; another version of A019538.
See also A019538: version with n > 0 and k > 0. - Philippe Deléham, Nov 03 2008
From Peter Bala, Jul 21 2014: (Start)
T(n,k) gives the number of (k-1)-dimensional faces in the interior of the first barycentric subdivision of the standard (n-1)-dimensional simplex. For example, the barycentric subdivision of the 1-simplex is o--o--o, with 1 interior vertex and 2 interior edges, giving T(2,1) = 1 and T(2,2) = 2.
This triangle is used when calculating the face vectors of the barycentric subdivision of a simplicial complex. Let S be an n-dimensional simplicial complex and write f_k for the number of k-dimensional faces of S, with the usual convention that f_(-1) = 1, so that F := (f_(-1), f_0, f_1,...,f_n) is the f-vector of S. If M(n) denotes the square matrix formed from the first n+1 rows and n+1 columns of the present triangle, then the vector F*M(n) is the f-vector of the first barycentric subdivision of the simplicial complex S (Brenti and Welker, Lemma 2.1). For example, the rows of Pascal's triangle A007318 (but with row and column indexing starting at -1) are the f-vectors for the standard n-simplexes. It follows that A007318*A131689, which equals A028246, is the array of f-vectors of the first barycentric subdivision of standard n-simplexes. (End)
This triangle T(n, k) appears in the o.g.f. G(n, x) = Sum_{m>=0} S(n, m)*x^m with S(n, m) = Sum_{j=0..m} j^n for n >= 1 as G(n, x) = Sum_{k=1..n} (x^k/(1 - x)^(k+2))*T(n, k). See also the Eulerian triangle A008292 with a Mar 31 2017 comment for a rewritten form. For the e.g.f. see A028246 with a Mar 13 2017 comment. - Wolfdieter Lang, Mar 31 2017
T(n,k) = the number of alignments of length k of n strings each of length 1. See Slowinski. An example is given below. Cf. A122193 (alignments of strings of length 2) and A299041 (alignments of strings of length 3). - Peter Bala, Feb 04 2018
The row polynomials R(n,x) are the Fubini polynomials. - Emanuele Munarini, Dec 05 2020
From Gus Wiseman, Feb 18 2022: (Start)
Also the number of patterns of length n with k distinct parts (or with maximum part k), where we define a pattern to be a finite sequence covering an initial interval of positive integers. For example, row n = 3 counts the following patterns:
(1,1,1) (1,2,2) (1,2,3)
(2,1,2) (1,3,2)
(2,2,1) (2,1,3)
(1,1,2) (2,3,1)
(1,2,1) (3,1,2)
(2,1,1) (3,2,1)
(End)
Regard A048994 as a lower-triangular matrix and divide each term A048994(n,k) by n!, then this is the matrix inverse. Because Sum_{k=0..n} (A048994(n,k) * x^n / n!) = A007318(x,n), Sum_{k=0..n} (A131689(n,k) * A007318(x,k)) = x^n. - Natalia L. Skirrow, Mar 23 2023
T(n,k) is the number of ordered partitions of [n] into k blocks. - Alois P. Heinz, Feb 21 2025

Examples

			The triangle T(n,k) begins:
  n\k 0 1    2     3      4       5        6        7        8        9      10 ...
  0:  1
  1:  0 1
  2:  0 1    2
  3:  0 1    6     6
  4:  0 1   14    36     24
  5:  0 1   30   150    240     120
  6:  0 1   62   540   1560    1800      720
  7:  0 1  126  1806   8400   16800    15120     5040
  8:  0 1  254  5796  40824  126000   191520   141120    40320
  9:  0 1  510 18150 186480  834120  1905120  2328480  1451520   362880
  10: 0 1 1022 55980 818520 5103000 16435440 29635200 30240000 16329600 3628800
  ... reformatted and extended. - _Wolfdieter Lang_, Mar 31 2017
From _Peter Bala_, Feb 04 2018: (Start)
T(4,2) = 14 alignments of length 2 of 4 strings of length 1. Examples include
  (i) A -    (ii) A -    (iii) A -
      B -         B -          - B
      C -         - C          - C
      - D         - D          - D
There are C(4,1) = 4 alignments of type (i) with a single gap character - in column 1, C(4,2) = 6 alignments of type (ii) with two gap characters in column 1 and C(4,3) = 4 alignments of type (iii) with three gap characters in column 1, giving a total of 4 + 6 + 4 = 14 alignments. (End)
		

Crossrefs

Case m=1 of the polynomials defined in A278073.
Cf. A000142 (diagonal), A000670 (row sums), A000012 (alternating row sums), A210029 (central terms).
Cf. A008292, A028246 (o.g.f. and e.g.f. of sums of powers).
A version for partitions is A116608, or by maximum A008284.
A version for compositions is A235998, or by maximum A048004.
Classes of patterns:
- A000142 = strict
- A005649 = anti-run, complement A069321
- A019536 = necklace
- A032011 = distinct multiplicities
- A060223 = Lyndon
- A226316 = (1,2,3)-avoiding, weakly A052709, complement A335515
- A296975 = aperiodic
- A345194 = alternating, up/down A350354, complement A350252
- A349058 = weakly alternating
- A351200 = distinct runs
- A351292 = distinct run-lengths

Programs

  • Julia
    function T(n, k)
        if k < 0 || k > n return 0 end
        if n == 0 && k == 0 return 1 end
        k*(T(n-1, k-1) + T(n-1, k))
    end
    for n in 0:7
        println([T(n, k) for k in 0:n])
    end
    # Peter Luschny, Mar 26 2020
    
  • Maple
    A131689 := (n,k) -> Stirling2(n,k)*k!: # Peter Luschny, Sep 17 2011
    # Alternatively:
    A131689_row := proc(n) 1/(1-t*(exp(x)-1)); expand(series(%,x,n+1)); n!*coeff(%,x,n); PolynomialTools:-CoefficientList(%,t) end:
    for n from 0 to 9 do A131689_row(n) od; # Peter Luschny, Jan 23 2017
  • Mathematica
    t[n_, k_] := k!*StirlingS2[n, k]; Table[t[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 25 2014 *)
    T[n_, k_] := If[n <= 0 || k <= 0, Boole[n == 0 && k == 0], Sum[(-1)^(i + k) Binomial[k, i] i^(n + k), {i, 0, k}]]; (* Michael Somos, Jul 08 2018 *)
  • PARI
    {T(n, k) = if( n<0, 0, sum(i=0, k, (-1)^(k + i) * binomial(k, i) * i^n))};
    /* Michael Somos, Jul 08 2018 */
    
  • SageMath
    @cached_function
    def F(n): # Fubini polynomial
        R. = PolynomialRing(ZZ)
        if n == 0: return R(1)
        return R(sum(binomial(n, k)*F(n - k)*x for k in (1..n)))
    for n in (0..9): print(F(n).list()) # Peter Luschny, May 21 2021

Formula

T(n,k) = k*(T(n-1,k-1) + T(n-1,k)) with T(0,0)=1. Sum_{k=0..n} T(n,k)*x^k = (-1)^n*A000629(n), A033999(n), A000007(n), A000670(n), A004123(n+1), A032033(n), A094417(n), A094418(n), A094419(n) for x = -2, -1, 0, 1, 2, 3, 4, 5, 6 respectively. [corrected by Philippe Deléham, Feb 11 2013]
Sum_{k=0..n} T(n,k)*x^(n-k) = A000012(n), A000142(n), A000670(n), A122704(n) for x=-1, 0, 1, 2 respectively. - Philippe Deléham, Oct 09 2007
Sum_{k=0..n} (-1)^k*T(n,k)/(k+1) = Bernoulli numbers A027641(n)/A027642(n). - Peter Luschny, Sep 17 2011
G.f.: F(x,t) = 1 + x*t + (x+x^2)*t^2/2! + (x+6*x^2+6*x^3)*t^3/3! + ... = Sum_{n>=0} R(n,x)*t^n/n!.
The row polynomials R(n,x) satisfy the recursion R(n+1,x) = (x+x^2)*R'(n,x) + x*R(n,x) where ' indicates differentiation with respect to x. - Philippe Deléham, Feb 11 2013
T(n,k) = [t^k] (n! [x^n] (1/(1-t*(exp(x)-1)))). - Peter Luschny, Jan 23 2017
The n-th row polynomial has the form x o x o ... o x (n factors), where o denotes the black diamond multiplication operator of Dukes and White. See also Bala, Example E8. - Peter Bala, Jan 08 2018
Showing 1-10 of 159 results. Next