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.

Previous Showing 11-20 of 2305 results. Next

A005843 The nonnegative even numbers: a(n) = 2n.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120
Offset: 0

Views

Author

Keywords

Comments

-2, -4, -6, -8, -10, -12, -14, ... are the trivial zeros of the Riemann zeta function. - Vivek Suri (vsuri(AT)jhu.edu), Jan 24 2008
If a 2-set Y and an (n-2)-set Z are disjoint subsets of an n-set X then a(n-2) is the number of 2-subsets of X intersecting both Y and Z. - Milan Janjic, Sep 19 2007
A134452(a(n)) = 0; A134451(a(n)) = 2 for n > 0. - Reinhard Zumkeller, Oct 27 2007
Omitting the initial zero gives the number of prime divisors with multiplicity of product of terms of n-th row of A077553. - Ray Chandler, Aug 21 2003
A059841(a(n))=1, A000035(a(n))=0. - Reinhard Zumkeller, Sep 29 2008
(APSO) Alternating partial sums of (a-b+c-d+e-f+g...) = (a+b+c+d+e+f+g...) - 2*(b+d+f...), it appears that APSO(A005843) = A052928 = A002378 - 2*(A116471), with A116471=2*A008794. - Eric Desbiaux, Oct 28 2008
A056753(a(n)) = 1. - Reinhard Zumkeller, Aug 23 2009
Twice the nonnegative numbers. - Juri-Stepan Gerasimov, Dec 12 2009
The number of hydrogen atoms in straight-chain (C(n)H(2n+2)), branched (C(n)H(2n+2), n > 3), and cyclic, n-carbon alkanes (C(n)H(2n), n > 2). - Paul Muljadi, Feb 18 2010
For n >= 1; a(n) = the smallest numbers m with the number of steps n of iterations of {r - (smallest prime divisor of r)} needed to reach 0 starting at r = m. See A175126 and A175127. A175126(a(n)) = A175126(A175127(n)) = n. Example (a(4)=8): 8-2=6, 6-2=4, 4-2=2, 2-2=0; iterations has 4 steps and number 8 is the smallest number with such result. - Jaroslav Krizek, Feb 15 2010
For n >= 1, a(n) = numbers k such that arithmetic mean of the first k positive integers is not integer. A040001(a(n)) > 1. See A145051 and A040001. - Jaroslav Krizek, May 28 2010
Union of A179082 and A179083. - Reinhard Zumkeller, Jun 28 2010
a(k) is the (Moore lower bound on and the) order of the (k,4)-cage: the smallest k-regular graph having girth four: the complete bipartite graph with k vertices in each part. - Jason Kimberley, Oct 30 2011
For n > 0: A048272(a(n)) <= 0. - Reinhard Zumkeller, Jan 21 2012
Let n be the number of pancakes that have to be divided equally between n+1 children. a(n) is the minimal number of radial cuts needed to accomplish the task. - Ivan N. Ianakiev, Sep 18 2013
For n > 0, a(n) is the largest number k such that (k!-n)/(k-n) is an integer. - Derek Orr, Jul 02 2014
a(n) when n > 2 is also the number of permutations simultaneously avoiding 213, 231 and 321 in the classical sense which can be realized as labels on an increasing strict binary tree with 2n-1 nodes. See A245904 for more information on increasing strict binary trees. - Manda Riehl Aug 07 2014
It appears that for n > 2, a(n) = A020482(n) + A002373(n), where all sequences are infinite. This is consistent with Goldbach's conjecture, which states that every even number > 2 can be expressed as the sum of two prime numbers. - Bob Selcoe, Mar 08 2015
Number of partitions of 4n into exactly 2 parts. - Colin Barker, Mar 23 2015
Number of neighbors in von Neumann neighborhood. - Dmitry Zaitsev, Nov 30 2015
Unique solution b( ) of the complementary equation a(n) = a(n-1)^2 - a(n-2)*b(n-1), where a(0) = 1, a(1) = 3, and a( ) and b( ) are increasing complementary sequences. - Clark Kimberling, Nov 21 2017
Also the maximum number of non-attacking bishops on an (n+1) X (n+1) board (n>0). (Cf. A000027 for rooks and queens (n>3), A008794 for kings or A030978 for knights.) - Martin Renner, Jan 26 2020
Integer k is even positive iff phi(2k) > phi(k), where phi is Euler's totient (A000010) [see reference De Koninck & Mercier]. - Bernard Schott, Dec 10 2020
Number of 3-permutations of n elements avoiding the patterns 132, 213, 312 and also number of 3-permutations avoiding the patterns 213, 231, 321. See Bonichon and Sun. - Michel Marcus, Aug 20 2022
a(n) gives the y-value of the integral solution (x,y) of the Pellian equation x^2 - (n^2 + 1)*y^2 = 1. The x-value is given by 2*n^2 + 1 (see Tattersall). - Stefano Spezia, Jul 24 2025

Examples

			G.f. = 2*x + 4*x^2 + 6*x^3 + 8*x^4 + 10*x^5 + 12*x^6 + 14*x^7 + 16*x^8 + ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 28.
  • J.-M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 529a pp. 71 and 257, Ellipses, 2004, Paris.
  • 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 256.

Crossrefs

a(n)=2*A001477(n). - Juri-Stepan Gerasimov, Dec 12 2009
Moore lower bound on the order of a (k,g) cage: A198300 (square); rows: A000027 (k=2), A027383 (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), this sequence (g=4), A002522 (g=5), A051890 (g=6), A188377 (g=7). - Jason Kimberley, Oct 30 2011
Cf. A231200 (boustrophedon transform).

Programs

Formula

G.f.: 2*x/(1-x)^2.
E.g.f.: 2*x*exp(x). - Geoffrey Critzer, Aug 25 2012
G.f. with interpolated zeros: 2x^2/((1-x)^2 * (1+x)^2); e.g.f. with interpolated zeros: x*sinh(x). - Geoffrey Critzer, Aug 25 2012
Inverse binomial transform of A036289, n*2^n. - Joshua Zucker, Jan 13 2006
a(0) = 0, a(1) = 2, a(n) = 2a(n-1) - a(n-2). - Jaume Oliver Lafont, May 07 2008
a(n) = Sum_{k=1..n} floor(6n/4^k + 1/2). - Vladimir Shevelev, Jun 04 2009
a(n) = A034856(n+1) - A000124(n) = A000217(n) + A005408(n) - A000124(n) = A005408(n) - 1. - Jaroslav Krizek, Sep 05 2009
a(n) = Sum_{k>=0} A030308(n,k)*A000079(k+1). - Philippe Deléham, Oct 17 2011
Digit sequence 22 read in base n-1. - Jason Kimberley, Oct 30 2011
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Vincenzo Librandi, Dec 23 2011
a(n) = 2*n = Product_{k=1..2*n-1} 2*sin(Pi*k/(2*n)), n >= 0 (undefined product := 1). See an Oct 09 2013 formula contribution in A000027 with a reference. - Wolfdieter Lang, Oct 10 2013
From Ilya Gutkovskiy, Aug 19 2016: (Start)
Convolution of A007395 and A057427.
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/2 = (1/2)*A002162 = (1/10)*A016655. (End)
From Bernard Schott, Dec 10 2020: (Start)
Sum_{n>=1} 1/a(n)^2 = Pi^2/24 = A222171.
Sum_{n>=1} (-1)^(n+1)/a(n)^2 = Pi^2/48 = A245058. (End)

A001045 Jacobsthal sequence (or Jacobsthal numbers): a(n) = a(n-1) + 2*a(n-2), with a(0) = 0, a(1) = 1; also a(n) = nearest integer to 2^n/3.

Original entry on oeis.org

0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, 5461, 10923, 21845, 43691, 87381, 174763, 349525, 699051, 1398101, 2796203, 5592405, 11184811, 22369621, 44739243, 89478485, 178956971, 357913941, 715827883, 1431655765, 2863311531, 5726623061, 11453246123
Offset: 0

Views

Author

Keywords

Comments

Don Knuth points out (personal communication) that Jacobsthal may never have seen the actual values of this sequence. However, Horadam uses the name "Jacobsthal sequence", such an important sequence needs a name, and there is a law that says the name for something should never be that of its discoverer. - N. J. A. Sloane, Dec 26 2020
Number of ways to tile a 3 X (n-1) rectangle with 1 X 1 and 2 X 2 square tiles.
Also, number of ways to tile a 2 X (n-1) rectangle with 1 X 2 dominoes and 2 X 2 squares. - Toby Gottfried, Nov 02 2008
Also a(n) counts each of the following four things: n-ary quasigroups of order 3 with automorphism group of order 3, n-ary quasigroups of order 3 with automorphism group of order 6, (n-1)-ary quasigroups of order 3 with automorphism group of order 2 and (n-2)-ary quasigroups of order 3. See the McKay-Wanless (2008) paper. - Ian Wanless, Apr 28 2008
Also the number of ways to tie a necktie using n + 2 turns. So three turns make an "oriental", four make a "four in hand" and for 5 turns there are 3 methods: "Kelvin", "Nicky" and "Pratt". The formula also arises from a special random walk on a triangular grid with side conditions (see Fink and Mao, 1999). - arne.ring(AT)epost.de, Mar 18 2001
Also the number of compositions of n + 1 ending with an odd part (a(2) = 3 because 3, 21, 111 are the only compositions of 3 ending with an odd part). Also the number of compositions of n + 2 ending with an even part (a(2) = 3 because 4, 22, 112 are the only compositions of 4 ending with an even part). - Emeric Deutsch, May 08 2001
Arises in study of sorting by merge insertions and in analysis of a method for computing GCDs - see Knuth reference.
Number of perfect matchings of a 2 X n grid upon replacing unit squares with tetrahedra (C_4 to K_4):
o----o----o----o...
| \/ | \/ | \/ |
| /\ | /\ | /\ |
o----o----o----o... - Roberto E. Martinez II, Jan 07 2002
Also the numerators of the reduced fractions in the alternating sum 1/2 - 1/4 + 1/8 - 1/16 + 1/32 - 1/64 + ... - Joshua Zucker, Feb 07 2002
Also, if A(n), B(n), C(n) are the angles of the n-orthic triangle of ABC then A(1) = Pi - 2*A, A(n) = s(n)*Pi + (-2)^n*A where s(n) = (-1)^(n-1) * a(n) [1-orthic triangle = the orthic triangle of ABC, n-orthic triangle = the orthic triangle of the (n-1)-orthic triangle]. - Antreas P. Hatzipolakis (xpolakis(AT)otenet.gr), Jun 05 2002
Also the number of words of length n+1 in the two letters s and t that reduce to the identity 1 by using the relations sss = 1, tt = 1 and stst = 1. The generators s and t and the three stated relations generate the group S3. - John W. Layman, Jun 14 2002
Sums of pairs of consecutive terms give all powers of 2 in increasing order. - Amarnath Murthy, Aug 15 2002
Excess clockwise moves (over counterclockwise) needed to move a tower of size n to the clockwise peg is -(-1)^n*(2^n - (-1)^n)/3; a(n) is its unsigned version. - Wouter Meeussen, Sep 01 2002
Also the absolute value of the number represented in base -2 by the string of n 1's, the negabinary repunit. The Mersenne numbers (A000225 and its subsequences) are the binary repunits. - Rick L. Shepherd, Sep 16 2002
Note that 3*a(n) + (-1)^n = 2^n is significant for Pascal's triangle A007318. It arises from a Jacobsthal decomposition of Pascal's triangle illustrated by 1 + 7 + 21 + 35 + 35 + 21 + 7 + 1 = (7 + 35 + 1) + (1 + 35 + 7) + (21 + 21) = 43 + 43 + 42 = 3a(7) - 1; 1 + 8 + 28 + 56 + 70 + 56 + 28 + 8 + 1 = (1 + 56 + 28) + (28 + 56 + 1) + (8 + 70 + 8) = 85 + 85 + 86 = 3a(8)+1. - Paul Barry, Feb 20 2003
Number of positive integers requiring exactly n signed bits in the nonadjacent form representation.
Equivalently, number of length-(n-1) words with letters {0, 1, 2} where no two consecutive letters are nonzero, see example and fxtbook link. - Joerg Arndt, Nov 10 2012
Counts walks between adjacent vertices of a triangle. - Paul Barry, Nov 17 2003
Every amphichiral rational knot written in Conway notation is a palindromic sequence of numbers, not beginning or ending with 1. For example, for 4 <= n <= 12, the amphichiral rational knots are: 2 2, 2 1 1 2, 4 4, 3 1 1 3, 2 2 2 2, 4 1 1 4, 3 1 1 1 1 3, 2 3 3 2, 2 1 2 2 1 2, 2 1 1 1 1 1 1 2, 6 6, 5 1 1 5, 4 2 2 4, 3 3 3 3, 2 4 4 2, 3 2 1 1 2 3, 3 1 2 2 1 3, 2 2 2 2 2 2, 2 2 1 1 1 1 2 2, 2 1 2 1 1 2 1 2, 2 1 1 1 1 1 1 1 1 2. For the number of amphichiral rational knots for n=2*k (k=1, 2, 3, ...), we obtain the sequence 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, ... - Slavik Jablan, Dec 26 2003
a(n+2) counts the binary sequences of total length n made up of codewords from C = {0, 10, 11}. - Paul Barry, Jan 23 2004
Number of permutations with no fixed points avoiding 231 and 132.
The n-th entry (n > 1) of the sequence is equal to the 2,2-entry of the n-th power of the unnormalized 4 X 4 Haar matrix: [1 1 1 0 / 1 1 -1 0 / 1 1 0 1 / 1 1 0 -1]. - Simone Severini, Oct 27 2004
a(n) is the number of Motzkin (n+1)-sequences whose flatsteps all occur at level 1 and whose height is less than or equal to 2. For example, a(4) = 5 counts UDUFD, UFDUD, UFFFD, UFUDD, UUDFD. - David Callan, Dec 09 2004
a(n+1) gives row sums of A059260. - Paul Barry, Jan 26 2005
If (m + n) is odd, then 3*(a(m) + a(n)) is always of the form a^2 + 2*b^2, where a and b both equal powers of 2; consequently every factor of (a(m) + a(n)) is always of the form a^2 + 2*b^2. - Matthew Vandermast, Jul 12 2003
Number of "0,0" in f_{n+1}, where f_0 = "1" and f_{n+1} = a sequence formed by changing all "1"s in f_n to "1,0" and all "0"s in f_n to "0,1". - Fung Cheok Yin (cheokyin_restart(AT)yahoo.com.hk), Sep 22 2006
All prime Jacobsthal numbers A049883[n] = {3, 5, 11, 43, 683, 2731, 43691, ...} have prime indices except for a(4) = 5. All prime Jacobsthal numbers with prime indices (all but a(4) = 5) are of the form (2^p + 1)/3 - the Wagstaff primes A000979[n]. Indices of prime Jacobsthal numbers are listed in A107036[n] = {3, 4, 5, 7, 11, 13, 17, 19, 23, 31, 43, 61, ...}. For n>1 A107036[n] = A000978[n] Numbers n such that (2^n + 1)/3 is prime. - Alexander Adamchuk, Oct 03 2006
Correspondence: a(n) = b(n)*2^(n-1), where b(n) is the sequence of the arithmetic means of previous two terms defined by b(n) = 1/2*(b(n-1) + b(n-2)) with initial values b(0) = 0, b(1) = 1; the g.f. for b(n) is B(x) := x/(1-(x^1+x^2)/2), so the g.f. A(x) for a(n) satisfies A(x) = B(2*x)/2. Because b(n) converges to the limit lim (1-x)*B(x) = 1/3*(b(0) + 2*b(1)) = 2/3 (for x --> 1), it follows that a(n)/2^(n-1) also converges to 2/3 (see also A103770). - Hieronymus Fischer, Feb 04 2006
Inverse: floor(log_2(a(n))) = n - 2 for n >= 2. Also: log_2(a(n) + a(n-1)) = n - 1 for n >= 1 (see also A130249). Characterization: x is a Jacobsthal number if and only if there is a power of 4 (= c) such that x is a root of p(x) = 9*x*(x-c) + (c-1)*(2*c+1) (see also the indicator sequence A105348). - Hieronymus Fischer, May 17 2007
This sequence counts the odd coefficients in the expansion of (1 + x + x^2)^(2^n - 1), n >= 0. - Tewodros Amdeberhan (tewodros(AT)math.mit.edu), Oct 18 2007, Jan 08 2008
2^(n+1) = 2*A005578(n) + 2*a(n) + 2*A000975(n-1). Let A005578(n), a(n), A000975(n-1) = triangle (a, b, c). Then ((S-c), (S-b), (S-a)) = (A005578(n-1), a(n-1), A000975(n-2)). Example: (a, b, c) = (11, 11, 10) = (A005578(5), a(5), A000975(4)). Then ((S-c), (S-b), (S-a)) = (6, 5, 5) = (A005578(4), a(4), A000975(3)). - Gary W. Adamson, Dec 24 2007
Sequence is identical to the absolute values of its inverse binomial transform. A similar result holds for [0,A001045*2^n]. - Paul Curtz, Jan 17 2008
From a(2) on (i.e., 1, 3, 5, 11, 21, ...) also: least odd number such that the subsets of {a(2), ..., a(n)} sum to 2^(n-1) different values, cf. A138000 and A064934. It is interesting to note the pattern of numbers occurring (or not occurring) as such a sum (A003158). - M. F. Hasler, Apr 09 2008
a(n) is the term (5, 1) of n-th power of the 5 X 5 matrix shown in A121231. - Gary W. Adamson, Oct 03 2008
A147612(a(n)) = 1. - Reinhard Zumkeller, Nov 08 2008
a(n+1) = Sum(A153778(i): 2^n <= i < 2^(n+1)). - Reinhard Zumkeller, Jan 01 2009
It appears that a(n) is also the number of integers between 2^n and 2^(n+1) that are divisible by 3 with no remainder. - John Fossaceca (john(AT)fossaceca.net), Jan 31 2009
Number of pairs of consecutive odious (or evil) numbers between 2^(n+1) and 2^(n+2), inclusive. - T. D. Noe, Feb 05 2009
Equals eigensequence of triangle A156319. - Gary W. Adamson, Feb 07 2009
A three-dimensional interpretation of a(n+1) is that it gives the number of ways of filling a 2 X 2 X n hole with 1 X 2 X 2 bricks. - Martin Griffiths, Mar 28 2009
Starting with offset 1 = INVERTi transform of A002605: (1, 2, 6, 16, 44, ...). - Gary W. Adamson, May 12 2009
Convolved with (1, 2, 2, 2, ...) = A000225: (1, 3, 7, 15, 31, ...). - Gary W. Adamson, May 23 2009
The product of a pair of successive terms is always a triangular number. - Giuseppe Ottonello, Jun 14 2009
Let A be the Hessenberg matrix of order n, defined by: A[1, j] = 1, A[i, i] := -2, A[i, i - 1] = -1, and A[i, j] = 0 otherwise. Then, for n >= 1, a(n) = (-1)^(n-1)*det(A). - Milan Janjic, Jan 26 2010
Let R denote the irreducible representation of the symmetric group S_3 of dimension 2, and let s and t denote respectively the sign and trivial irreducible representations of dimension 1. The decomposition of R^n into irreducible representations consists of a(n) copies of R and a(n-1) copies of each of s and t. - Andrew Rupinski, Mar 12 2010
As a fraction: 1/88 = 0.0113636363... or 1/9898 = 0.00010103051121... - Mark Dols, May 18 2010
Starting with "1" = the INVERT transform of (1, 0, 2, 0, 4, 0, 8, ...); e.g., a(7) = 43 = (1, 1, 1, 3, 5, 11, 21) dot (8, 0, 4, 0, 2, 0, 1) = (8 + 4 + 10 + 21) = 43. - Gary W. Adamson, Oct 28 2010
Rule 28 elementary cellular automaton (A266508) generates this sequence. - Paul Muljadi, Jan 27 2011
This is a divisibility sequence. - Michael Somos, Feb 06 2011
From L. Edson Jeffery, Apr 04 2011: (Start)
Let U be the unit-primitive matrix (see [Jeffery])
U = U_(6,2) =
(0 0 1)
(0 2 0)
(2 0 1).
Then a(n+1) = (Trace(U^n))/3, a(n+1) = ((U^n){3, 3})/3, a(n) = ((U^n){1, 3})/3 and a(n) = ((U^(n+1))_{1, 1})/2. (End)
The compositions of n in which each natural number is colored by one of p different colors are called p-colored compositions of n. For n >= 2, 3*a(n-1) equals the number of 3-colored compositions of n with all parts greater than or equal to 2, such that no adjacent parts have the same color. - Milan Janjic, Nov 26 2011
This sequence is connected with the Collatz problem. We consider the array T(i, j) where the i-th row gives the parity trajectory of i, for example for i = 6, the infinite trajectory is 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 -> 4 -> 2 -> 1 -> 4 -> 2 -> 1... and T(6, j) = [0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, ..., 1, 0, 0, 1, ...]. Now, we consider the sum of the digits "1" of each column. We obtain the sequence a(n) = Sum_{k = 1..2^n} T(k, n) = Sum {k = 1..2^n} digits "1" of the n-th column. Because a(n) + a(n+1) = 2^n, then a(n+1) = Number of digits "0" among the 2^n elements of the n-th column. - _Michel Lagneau, Jan 11 2012
3!*a(n-1) is apparently the trace of the n-th power of the adjacency matrix of the complete 3-graph, a 3 X 3 matrix with diagonal elements all zero and off-diagonal all ones. The off-diagonal elements for the n-th power are all equal to a(n) while each diagonal element seems to be a(n) + 1 for an even power and a(n) - 1 for an odd. These are related to the lengths of closed paths on the graph (see Delfino and Viti's paper). - Tom Copeland, Nov 06 2012
From Paul Curtz, Dec 11 2012: (Start)
2^n * a(-n) = (-1)^(n-1) * a(n), which extends the sequence to negative indices: ..., -5/16, 3/8, -1/4, 1/2, 0, 1, 1, 3, 5, ...
The "autosequence" property with respect to the binomial transform mentioned in my comment of Jan 17 2008 is still valid if the term a(-1) is added to the array of the sequence and its iterated higher-order differences in subsequent rows:
0 1/2 1/2 3/2 5/2 11/2 ...
1/2 0 1 1 3 5 ...
-1/2 1 0 2 2 6 ...
3/2 -1 2 0 4 4 ...
-5/2 3 -2 4 0 8 ...
11/2 -5 6 -4 8 0 ...
The main diagonal in this array contains 0's. (End)
Assign to a triangle T(n, 0) = 1 and T(n+1, 1) = n; T(r, c) = T(r-1, c-1) + T(r-1, c-2) + T(r-2, c-2). Then T(n+1, n) - T(n, n) = a(n). - J. M. Bergot, May 02 2013
a(n+1) counts clockwise walks on n points on a circle that take steps of length 1 and 2, return to the starting point after two full circuits, and do not duplicate any steps (USAMO 2013, problem 5). - Kiran S. Kedlaya, May 11 2013
Define an infinite square array m by m(n, 0) = m(0, n) = a(n) in top row and left column and m(i, j) = m(i, j-1) + m(i-1, j-1) otherwise, then m(n+1, n+1) = 3^(n-1). - J. M. Bergot, May 10 2013
a(n) is the number of compositions (ordered partitions) of n - 1 into one sort of 1's and two sorts of 2's. Example: the a(4) = 5 compositions of 3 are 1 + 1 + 1, 1 + 2, 1 + 2', 2 + 1 and 2' + 1. - Bob Selcoe, Jun 24 2013
Without 0, a(n)/2^n equals the probability that n will occur as a partial sum in a randomly-generated infinite sequence of 1's and 2's. The limiting ratio is 2/3. - Bob Selcoe, Jul 04 2013
Number of conjugacy classes of Z/2Z X Z/2Z in GL(2,2^(n+1)). - Jared Warner, Aug 18 2013
a(n) is the top left entry of the (n-1)-st power of the 3 X 3 matrix [1, 1, 1, 1, 0, 0, 1, 0, 0]. a(n) is the top left entry of the (n+1)-st power of any of the six 3 X 3 matrices [0, 1, 0; 1, 1, 1; 0, 1, 0], [0, 1, 1; 0, 1, 1; 1, 1, 0], [0, 0, 1; 1, 1, 1; 1, 1, 0], [0, 1, 1; 1, 0, 1; 0, 1, 1], [0, 0, 1; 0, 0, 1; 1, 1, 1] or [0, 1, 0; 1, 0, 1; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
This is the only integer sequence from the family of homogeneous linear recurrence of order 2 given by a(n) = k*a(n-1) + t*a(n-2) with positive integer coefficients k and t and initial values a(0) = 0 and a(1) = 1 whose ratio a(n+1)/a(n) converges to 2 as n approaches infinity. - Felix P. Muga II, Mar 14 2014
This is the Lucas sequence U(1, -2). - Felix P. Muga II, Mar 21 2014
sqrt(a(n+1) * a(n-1)) -> a(n) + 3/4 if n is even, and -> a(n) - 3/4 if n is odd, for n >= 2. - Richard R. Forberg, Jun 24 2014
a(n+1) counts closed walks on the end vertices of P_3 containing one loop at the middle vertex. a(n-1) counts closed walks on the middle vertex of P_3 containing one loop at that vertex. - David Neil McGrath, Nov 07 2014
From César Eliud Lozada, Jan 21 2015: (Start)
Let P be a point in the plane of a triangle ABC (with sides a, b, c) and barycentric coordinates P = [x:y:z]. The Complement of P with respect to ABC is defined to be Complement(P) = [b*y + c*z : c*z + a*x : a*x + b*y].
Then, for n >= 1, Complement(Complement(...(Complement(P))..)) = (n times) =
[2*a(n-1)*a*x + (2*a(n-1) - (-1)^n)*(b*y + c*z):
2*a(n-1)*b*y + (2*a(n-1) - (-1)^n)*(c*z + a*x):
2*a(n-1)*c*z + (2*a(n-1) - (-1)^n)*(a*x + b*y)]. (End)
a(n) (n >= 2) is the number of induced hypercubes of the Fibonacci cube Gamma(n-2). See p. 513 of the Klavzar reference. Example: a(5) = 11. Indeed, the Fibonacci cube Gamma(3) is <>- (cycle C(4) with a pendant edge) and the hypercubes are: 5 vertices, 5 edges, and 1 square. - Emeric Deutsch, Apr 07 2016
If the sequence of points {P_i(x_i, y_i)} on the cubic y = a*x^3 + b*x^2 + c*x + d has the property that the segment P_i(x_i, y_i) P_i+1(x_i+1, y_i+1) is always tangent to the cubic at P_i+1(x_i+1, y_i+1) then a(n) = -2^n*a/b*(x_(n+1)-(-1/2)^n*x_1). - Michael Brozinsky, Aug 01 2016
With the quantum integers defined by [n+1]A000225%20are%20given%20by%20q%20=%20sqrt(2).%20Cf.%20A239473.%20-%20_Tom%20Copeland">q = (q^(n+1) - q^(-n-1)) / (q - q^(-1)), the Jacobsthal numbers are a(n+1) = (-1)^n*q^n [n+1]_q with q = i * sqrt(2) for i^2 = -1, whereas the signed Mersenne numbers A000225 are given by q = sqrt(2). Cf. A239473. - _Tom Copeland, Sep 05 2016
Every positive integer has a unique expression as a sum of Jacobsthal numbers in which the index of the smallest summand is odd, with a(1) and a(2) both allowed. See the L. Carlitz, R. Scoville, and V. E. Hoggatt, Jr. reference. - Ira M. Gessel, Dec 31 2016. See A280049 for these expansions. - N. J. A. Sloane, Dec 31 2016
For n > 0, a(n) equals the number of ternary words of length n-1 in which 0 and 1 avoid runs of odd lengths. - Milan Janjic, Jan 08 2017
For n > 0, a(n) equals the number of orbits of the finite group PSL(2,2^n) acting on subsets of size 4 for the 2^n+1 points of the projective line. - Paul M. Bradley, Jan 31 2017
For n > 1, number of words of length n-2 over alphabet {1,2,3} such that no odd letter is followed by an odd letter. - Armend Shabani, Feb 17 2017
Also, the decimal representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 678", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. See A283641. - Robert Price, Mar 12 2017
Also the number of independent vertex sets and vertex covers in the 2 X (n-2) king graph. - Eric W. Weisstein, Sep 21 2017
From César Eliud Lozada, Dec 14 2017: (Start)
Let T(0) be a triangle and let T(1) be the medial triangle of T(0), T(2) the medial triangle of T(1) and, in general, T(n) the medial triangle of T(n-1). The barycentric coordinates of the first vertex of T(n) are [2*a(n-1)/a(n), 1, 1], for n > 0.
Let S(0) be a triangle and let S(1) be the antimedial triangle of S(0), S(2) the antimedial triangle of S(1) and, in general, S(n) the antimedial triangle of S(n-1). The barycentric coordinates of the first vertex of S(n) are [-a(n+1)/a(n), 1, 1], for n > 0. (End)
a(n) is also the number of derangements in S_{n+1} with empty peak set. - Isabella Huang, Apr 01 2018
For n > 0, gcd(a(n), a(n+1)) = 1. - Kengbo Lu, Jul 27 2020
Number of 2-compositions of n+1 with 1 not allowed as a part; see Hopkins & Ouvry reference. - Brian Hopkins, Aug 17 2020
The number of Hamiltonian paths of the flower snark graph of even order 2n > 2 is 12*a(n-1). - Don Knuth, Dec 25 2020
When set S = {1, 2, ..., 2^n}, n>=0, then the largest subset T of S with the property that if x is in T, then 2*x is not in T, has a(n+1) elements. For example, for n = 4, #S = 16, a(5) = 11 with T = {1, 3, 4, 5, 7, 9, 11, 12, 13, 15, 16} (see Hassan Tarfaoui link, Concours Général 1991). - Bernard Schott, Feb 14 2022
a(n) is the number of words of length n over a binary alphabet whose position in the lexicographic order is one more than a multiple of three. a(3) = 3: aaa, abb, bba. - Alois P. Heinz, Apr 13 2022
Named by Horadam (1988) after the German mathematician Ernst Jacobsthal (1882-1965). - Amiram Eldar, Oct 02 2023
Define the sequence u(n) = (u(n-1) + u(n-2))/u(n-3) with u(0) = 0, u(1) = 1, u(2) = u(3) = -1. Then u(4*n) = -1 + (-1)^n/a(n+1), u(4*n+1) = 2 - (-1)^n/a(n+1), u(4*n+2) = u(4*n+3) = -1. For example, a(3) = 3 and u(8) = -2/3, u(9) = 5/3, u(10) = u(11) = -1. - Michael Somos, Oct 24 2023
From Miquel A. Fiol, May 25 2024: (Start)
Also, a(n) is the number of (3-color) states of a cycle (n+1)-pole C_{n+1} with n+1 terminals (or semiedges).
For instance, for n=3, the a(3)=3 states (3-coloring of the terminals) of C_4 are
a a a a a b
a a b b a b (End)
Also, with offset 1, the cogrowth sequence of the 6-element dihedral group D3. - Sean A. Irvine, Nov 04 2024

Examples

			a(2) = 3 because the tiling of the 3 X 2 rectangle has either only 1 X 1 tiles, or one 2 X 2 tile in one of two positions (together with two 1 X 1 tiles).
From _Joerg Arndt_, Nov 10 2012: (Start)
The a(6)=21 length-5 ternary words with no two consecutive letters nonzero are (dots for 0's)
[ 1]   [ . . . . ]
[ 2]   [ . . . 1 ]
[ 3]   [ . . . 2 ]
[ 4]   [ . . 1 . ]
[ 5]   [ . . 2 . ]
[ 6]   [ . 1 . . ]
[ 7]   [ . 1 . 1 ]
[ 8]   [ . 1 . 2 ]
[ 9]   [ . 2 . . ]
[10]   [ . 2 . 1 ]
[11]   [ . 2 . 2 ]
[12]   [ 1 . . . ]
[13]   [ 1 . . 1 ]
[14]   [ 1 . . 2 ]
[15]   [ 1 . 1 . ]
[16]   [ 1 . 2 . ]
[17]   [ 2 . . . ]
[18]   [ 2 . . 1 ]
[19]   [ 2 . . 2 ]
[20]   [ 2 . 1 . ]
[21]   [ 2 . 2 . ]
(End)
G.f. = x + x^2 + 3*x^3 + 5*x^4 + 11*x^5 + 21*x^6 + 43*x^7 + 85*x^8 + 171*x^9 + ...
		

References

  • Jathan Austin and Lisa Schneider, Generalized Fibonacci sequences in Pythagorean triple preserving sequences, Fib. Q., 58:1 (2020), 340-350.
  • Thomas Fink and Yong Mao, The 85 ways to tie a tie, Fourth Estate, London, 1999; Die 85 Methoden eine Krawatte zu binden. Hoffmann und Kampe, Hamburg, 1999.
  • International Mathematical Olympiad 2001, Hong Kong Preliminary Selection Contest Problem #16.
  • Jablan S. and Sazdanovic R., LinKnot: Knot Theory by Computer, World Scientific Press, 2007. See p. 80.
  • Ernst Erich Jacobsthal, Fibonaccische Polynome und Kreisteilungsgleichungen, Sitzungsber. Berliner Math. Gesell. 17 (1919-1920), 43-57.
  • Tanya Khovanova, "Coins and Logic", Chapter 6, The Mathematics of Various Entertaining Subjects: Volume 3 (2019), Jennifer Beineke & Jason Rosenhouse, eds. Princeton University Press, Princeton and Oxford, p. 73. ISBN: 0691182582, 978-0691182582.
  • Donald E. Knuth, Art of Computer Programming, Vol. 3, Sect. 5.3.1, Eq. 13.
  • Thomas Koshy, Fibonacci and Lucas numbers with applications, Wiley, 2001, p. 98.
  • Steven Roman, Introduction to Coding and Information Theory, Springer Verlag, 1996, 41-42.
  • P. D. Seymour and D. J. A. Welsh, Combinatorial applications of an inequality form statistical mechanics, Math. Proc. Camb. Phil. Soc. 77 (1975), 485-495. [Although Daykin et al. (1979) claim that the present sequence is studied in this article, it does not seem to be explicitly mentioned. Note that definition of log-convex in (3.1) is wrong. - N. J. A. Sloane, Dec 26 2020]
  • 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).
  • Robert M. Young, Excursions in Calculus, MAA, 1992, p. 239

Crossrefs

Partial sums of this sequence give A000975, where there are additional comments from B. E. Williams and Bill Blewett on the tie problem.
A002487(a(n)) = A000045(n).
Row sums of A059260, A156667 and A134317. Equals A026644(n-2)+1 for n > 1.
a(n) = A073370(n-1, 0), n >= 1 (first column of triangle).
Cf. A266508 (binary), A081857 (base 4), A147612 (characteristic function).
Cf. A049883 = primes in this sequence, A107036 = indices of primes, A129738.
Cf. A091084 (mod 10), A239473, A280049.
Bisections: A002450, A007583.
Cf. A077925 (signed version).

Programs

  • Haskell
    a001045 = (`div` 3) . (+ 1) . a000079
    a001045_list = 0 : 1 :
       zipWith (+) (map (2 *) a001045_list) (tail a001045_list)
    -- Reinhard Zumkeller, Mar 24 2013, Jan 05 2012, Feb 05 2011
    
  • Magma
    [n le 2 select n-1 else Self(n-1)+2*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Jun 27 2016
    
  • Maple
    A001045 := proc(n)
      (2^n-(-1)^n)/3 ;
    end proc: # R. J. Mathar, Dec 18 2012
  • Mathematica
    Jacob0[n_] := (2^n - (-1)^n)/3; Table[Jacob0[n], {n, 0, 33}] (* Robert G. Wilson v, Dec 05 2005 *)
    Array[(2^# - (-1)^#)/3 &, 33, 0] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *)
    LinearRecurrence[{1, 2}, {0, 1}, 40] (* Harvey P. Dale, Nov 30 2011 *)
    CoefficientList[Series[x/(1 - x - 2 x^2), {x, 0, 34}], x] (* Robert G. Wilson v, Jul 21 2015 *)
    Table[(2^n - (-1)^n)/3, {n, 0, 20}] (* Eric W. Weisstein, Sep 21 2017 *)
    Table[Abs[QBinomial[n, 1, -2]], {n, 0, 35}] (* John Keith, Jan 29 2022 *)
  • Maxima
    a[0]:0$
    a[n]:=2^(n-1)-a[n-1]$
    A001045(n):=a[n]$
    makelist(A001045(n),n,0,30); /* Martin Ettl, Nov 05 2012 */
    
  • PARI
    a(n) = (2^n - (-1)^n) / 3
    
  • PARI
    M=[1,1,0;1,0,1;0,1,1];for(i=0,34,print1((M^i)[2,1],",")) \\ Lambert Klasen (lambert.klasen(AT)gmx.net), Jan 28 2005
    
  • PARI
    a=0; for(n=0,34,print1(a,", "); a=2*(a-n%2)+1) \\ K. Spage, Aug 22 2014
    
  • Python
    # A001045.py
    def A001045():
        a, b = 0, 1
        while True:
            yield a
            a, b = b, b+2*a
    sequence = A001045()
    [next(sequence) for i in range(20)] # David Radcliffe, Jun 26 2016
    
  • Python
    [(2**n-(-1)**n)//3 for n in range(40)] # Gennady Eremin, Mar 03 2022
  • Sage
    [lucas_number1(n, 1, -2) for n in range(34)]  # Zerinvary Lajos, Apr 22 2009
    # Alternatively:
    a = BinaryRecurrenceSequence(1,2)
    [a(n) for n in (0..34)] # Peter Luschny, Aug 29 2016
    

Formula

a(n) = 2^(n-1) - a(n-1). a(n) = 2*a(n-1) - (-1)^n = (2^n - (-1)^n)/3.
G.f.: x/(1 - x - 2*x^2) = x/((x+1)*(1-2*x)). Simon Plouffe in his 1992 dissertation
E.g.f.: (exp(2*x) - exp(-x))/3.
a(2*n) = 2*a(2*n-1)-1 for n >= 1, a(2*n+1) = 2*a(2*n)+1 for n >= 0. - Lee Hae-hwang, Oct 11 2002; corrected by Mario Catalani (mario.catalani(AT)unito.it), Dec 04 2002
Also a(n) is the coefficient of x^(n-1) in the bivariate Fibonacci polynomials F(n)(x, y) = x*F(n-1)(x, y) + y*F(n-2)(x, y), with y=2*x^2. - Mario Catalani (mario.catalani(AT)unito.it), Dec 04 2002
a(n) = Sum_{k=1..n} binomial(n, k)*(-1)^(n+k)*3^(k-1). - Paul Barry, Apr 02 2003
The ratios a(n)/2^(n-1) converge to 2/3 and every fraction after 1/2 is the arithmetic mean of the two preceding fractions. - Gary W. Adamson, Jul 05 2003
a(n) = U(n-1, i/(2*sqrt(2)))*(-i*sqrt(2))^(n-1) with i^2=-1. - Paul Barry, Nov 17 2003
a(n+1) = Sum_{k=0..ceiling(n/2)} 2^k*binomial(n-k, k). - Benoit Cloitre, Mar 06 2004
a(2*n) = A002450(n) = (4^n - 1)/3; a(2*n+1) = A007583(n) = (2^(2*n+1) + 1)/3. - Philippe Deléham, Mar 27 2004
a(n) = round(2^n/3) = (2^n + (-1)^(n-1))/3 so lim_{n->infinity} 2^n/a(n) = 3. - Gerald McGarvey, Jul 21 2004
a(n) = Sum_{k=0..n-1} (-1)^k*2^(n-k-1) = Sum_{k=0..n-1}, 2^k*(-1)^(n-k-1). - Paul Barry, Jul 30 2004
a(n+1) = Sum_{k=0..n} binomial(k, n-k)*2^(n-k). - Paul Barry, Oct 07 2004
a(n) = Sum_{k=0..n-1} W(n-k, k)*(-1)^(n-k)*binomial(2*k,k), W(n, k) as in A004070. - Paul Barry, Dec 17 2004
From Paul Barry, Jan 17 2005: (Start)
a(n) = Sum_{k=0..n} k*binomial(n-1, (n-k)/2)*(1+(-1)^(n+k))*floor((2*k+1)/3).
a(n+1) = Sum_{k=0..n} k*binomial(n-1, (n-k)/2)*(1+(-1)^(n+k))*(A042965(k)+0^k). (End)
From Paul Barry, Jan 17 2005: (Start)
a(n+1) = ceiling(2^n/3) + floor(2^n/3) = (ceiling(2^n/3))^2 - (floor(2^n/3))^2.
a(n+1) = A005578(n) + A000975(n-1) = A005578(n)^2 - A000975(n-1)^2. (End)
a(n+1) = Sum_{k=0..n} Sum_{j=0..n} (-1)^(n-j)*binomial(j, k). - Paul Barry, Jan 26 2005
Let M = [1, 1, 0; 1, 0, 1; 0, 1, 1], then a(n) = (M^n)[2, 1], also matrix characteristic polynomial x^3 - 2*x^2 - x + 2 defines the three-step recursion a(0)=0, a(1)=1, a(2)=1, a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n > 2. - Lambert Klasen (lambert.klasen(AT)gmx.net), Jan 28 2005
a(n) = ceiling(2^(n+1)/3) - ceiling(2^n/3) = A005578(n+1) - A005578(n). - Paul Barry, Oct 08 2005
a(n) = floor(2^(n+1)/3) - floor(2^n/3) = A000975(n) - A000975(n-1). - Paul Barry, Oct 08 2005
From Paul Barry, Feb 20 2003: (Start)
a(n) = Sum_{k=0..floor(n/3)} binomial(n, f(n-1)+3*k);
a(n) = Sum_{k=0..floor(n/3)} binomial(n, f(n-2)+3*k), where f(n)=A080425(n). (End)
From Miklos Kristof, Mar 07 2007: (Start)
a(2*n) = (1/3)*Product_{d|n} cyclotomic(d,4).
a(2*n+1) = (1/3)*Product_{d|2*n+1} cyclotomic(2*d,2). (End)
From Hieronymus Fischer, Apr 23 2007: (Start)
The a(n) are closely related to nested square roots; this is 2*sin(2^(-n)*Pi/2*a(n)) = sqrt(2-sqrt(2-sqrt(2-sqrt(...sqrt(2)))...) {with the '2' n times, n >= 0}.
Also 2*cos(2^(-n)*Pi*a(n)) = sqrt(2-sqrt(2-sqrt(2-sqrt(...sqrt(2)))...) {with the '2' n-1 times, n >= 1} as well as
2*sin(2^(-n)*3/2*Pi*a(n)) = sqrt(2+sqrt(2+sqrt(2+sqrt(...sqrt(2)))...) {with the '2' n times, n >= 0} and
2*cos(2^(-n)*3*Pi*a(n)) = -sqrt(2+sqrt(2+sqrt(2+sqrt(...sqrt(2)))...) {with the '2' n-1 times, n >= 1}.
a(n) = 2^(n+1)/Pi*arcsin(b(n+1)/2) where b(n) is defined recursively by b(0)=2, b(n)=sqrt(2-b(n-1)).
There is a similar formula regarding the arccos function, this is a(n) = 2^n/Pi*arccos(b(n)/2).
With respect to the sequence c(n) defined recursively by c(0)=-2, c(n)=sqrt(2+c(n-1)), the following formulas hold true: a(n) = 2^n/3*(1-(-1)^n*(1-2/Pi*arcsin(c(n+1)/2))); a(n) = 2^n/3*(1-(-1)^n*(1-1/Pi*arccos(-c(n)/2))).
(End)
Sum_{k=0..n} A039599(n,k)*a(k) = A049027(n), for n >= 1. - Philippe Deléham, Jun 10 2007
Sum_{k=0..n} A039599(n,k)*a(k+1) = A067336(n). - Philippe Deléham, Jun 10 2007
Let T = the 3 X 3 matrix [1,1,0; 1,0,1; 0,1,1]. Then T^n * [1,0,0,] = [A005578(n), a(n), A000975(n-1)]. - Gary W. Adamson, Dec 24 2007
a(n) + a(n+5) = 11*2^n. - Paul Curtz, Jan 17 2008
a(n) = Sum_{k=1..n} K(2, k)*a(n - k), where K(n,k) = k if 0 <= k <= n and K(n,k)=0 otherwise. (When using such a K-coefficient, several different arguments to K or several different definitions of K may lead to the same integer sequence. For example, the Fibonacci sequence can be generated in several ways using the K-coefficient.) - Thomas Wieder, Jan 13 2008
a(n) + a(n+2*k+1) = a(2*k+1)*2^n. - Paul Curtz, Feb 12 2008
a(n) = lower left term in the 2 X 2 matrix [0,2; 1,1]^n. - Gary W. Adamson, Mar 02 2008
a(n+1) = Sum_{k=0..n} A109466(n,k)*(-2)^(n-k). -Philippe Deléham, Oct 26 2008
a(n) = sqrt(8*a(n-1)*a(n-2) + 1). E.g., sqrt(3*5*8+1) = 11, sqrt(5*11*8+1) = 21. - Giuseppe Ottonello, Jun 14 2009
Let p[i] = Fibonacci(i-1) and let A be 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(p-1) = p*A007663(n)/3 if n > 1, and a(p-1) = p*A096060(n) if n > 2, with p=prime(n). - Jonathan Sondow, Jul 19 2010
Algebraically equivalent to replacing the 5's with 9's in the explicit (Binet) formula for the n-th term in the Fibonacci sequence: The formula for the n-th term in the Fibonacci sequence is F(n) = ((1+sqrt(5))^n - (1-sqrt(5))^n)/(2^n*sqrt(5)). Replacing the 5's with 9's gives ((1+sqrt(9))^n - (1-sqrt(9))^n)/(2^n*sqrt(9)) = (2^n+(-1)^(n+1))/3 = (2^n-(-1)^(n))/3 = a(n). - Jeffrey R. Goodwin, May 27 2011
For n > 1, a(n) = A000975(n-1) + (1 + (-1)^(n-1))/2. - Vladimir Shevelev, Feb 27 2012
From Sergei N. Gladkovskii, Jun 12 2012: (Start)
G.f.: x/(1-x-2*x^2) = G(0)/3; G(k) = 1 - ((-1)^k)/(2^k - 2*x*4^k/(2*x*2^k - ((-1)^k)/G(k+1))); (continued fraction 3 kind, 3-step).
E.g.f.: G(0)/3; G(k) = 1 - ((-1)^k)/(2^k - 2*x*4^k/(2*x*2^k - ((-1)^k)*(k+1)/G(k+1))); (continued fraction 3rd kind, 3-step). (End)
a(n) = 2^k * a(n-k) + (-1)^(n+k)*a(k). - Paul Curtz, Jean-François Alcover, Dec 11 2012
a(n) = sqrt((A014551(n))^2 + (-1)^(n-1)*2^(n+2))/3. - Vladimir Shevelev, Mar 13 2013
G.f.: Q(0)/3, 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 21 2013
G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(2*k+1 + 2*x)/( x*(2*k+2 + 2*x) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 29 2013
G.f.: Q(0) -1, where Q(k) = 1 + 2*x^2 + (k+2)*x - x*(k+1 + 2*x)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 06 2013
a(n+2) = Sum_{k=0..n} A108561(n,k)*(-2)^k. - Philippe Deléham, Nov 17 2013
a(n) = (Sum_{k=1..n, k odd} C(n,k)*3^(k-1))/2^(n-1). - Vladimir Shevelev, Feb 05 2014
a(-n) = -(-1)^n * a(n) / 2^n for all n in Z. - Michael Somos, Mar 18 2014
a(n) = (-1)^(n-1)*Sum_{k=0..n-1} A135278(n-1,k)*(-3)^k = (2^n - (-1)^n)/3 = (-1)^(n-1)*Sum_{k=0..n-1} (-2)^k. Equals (-1)^(n-1)*Phi(n,-2), where Phi is the cyclotomic polynomial when n is an odd prime. (For n > 0.) - Tom Copeland, Apr 14 2014
From Peter Bala, Apr 06 2015: (Start)
a(2*n)/a(n) = A014551(n) for n >= 1; a(3*n)/a(n) = 3*A245489(n) for n >= 1.
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 ) = Sum_{n >= 0} A084175(n+1)*x^n.
exp( Sum_{n >= 1} a(4*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015266(n+3)*(-x)^n.
exp( Sum_{n >= 1} a(5*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015287(n+4)*x^n.
exp( Sum_{n >= 1} a(6*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015305(n+5)*(-x)^n.
exp( Sum_{n >= 1} a(7*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015323(n+6)*x^n.
exp( Sum_{n >= 1} a(8*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015338(n+7)*(-x)^n.
exp( Sum_{n >= 1} a(9*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015356(n+8)*x^n.
exp( Sum_{n >= 1} a(10*n)/a(n)*x^n/n ) = Sum_{n >= 0} A015371(n+9)*(-x)^n. (End)
a(n) = (1-(-1)^n)/2 + floor((2^n)/3). - Reiner Moewald, Jun 05 2015
a(n+k)^2 - A014551(k)*a(n)*a(n+k) + (-2)^k*a(n)^2 = (-2)^n*a(k)^2, for n >= 0 and k >= 0. - Alexander Samokrutov, Jul 21 2015
Dirichlet g.f.: (PolyLog(s,2) + (1 - 2^(1-s))*zeta(s))/3. - Ilya Gutkovskiy, Jun 27 2016
From Yuchun Ji, Apr 08 2018: (Start)
a(m)*a(n) + a(m-1)*a(n-1) - 2*a(m-2)*a(n-2) = 2^(m+n-3).
a(m+n-1) = a(m)*a(n) + 2*a(m-1)*a(n-1); a(m+n) = a(m+1)*a(n+1) - 4*a(m-1)*a(n-1).
a(2*n-1) = a(n)^2 + 2*a(n-1)^2; a(2*n) = a(n+1)^2 - 4*a(n-1)^2. (End)
a(n+4) = a(n) + 5*2^n, a(0) = 0, a(1..4) = [1,1,3,5]. That is to say, for n > 0, the ones digits of Jacobsthal numbers follow the pattern 1,1,3,5,1,1,3,5,1,1,3,5,.... - Yuchun Ji, Apr 25 2019
a(n) mod 10 = A091084(n). - Alois P. Heinz, Apr 25 2019
The sequence starting with "1" is the second INVERT transform of (1, -1, 3, -5, 11, -21, 43, ...). - Gary W. Adamson, Jul 08 2019
From Kai Wang, Jan 14 2020: (Start)
a(n)^2 - a(n+1)*a(n-1) = (-2)^(n-1).
a(n)^2 - a(n+r)*a(n-r) = (-2)^(n-r)*a(r)^2.
a(m)*a(n+1) - a(m+1)*a(n) = (-2)^n*a(m-n).
a(m-n) = (-1)^n*(a(m)*A014551(n) - A014551(m)*a(n))/(2^(n+1)).
a(m+n) = (a(m)*A014551(n) + A014551(m)*a(n))/2.
A014551(n)^2 - A014551(n+r)*A014551(n-r) = 9*(-1)^(n-r-1)*2^(n-r)*a(r)^2 .
A014551(m)*A014551(n+1) - A014551(m+1)*A014551(n) = 9*(-1)^(n-1)*2^(n)*a(m-n).
A014551(m-n) = (-1)^(n)*(A014551(m)*A014551(n) - 9*a(m)*a(n))/2^(n+1).
A014551(m+n) = (A014551(m)*A014551(n) + 9*a(m)*a(n))/2.
a(n) = Sum_{i=0..n-1; j=0..n-1; i+2*j=n-1} 2^j*((i+j)!/(i!*j!)). (End)
For n > 0, 1/(2*a(n+1)) = Sum_{m>=n} a(m)/(a(m+1)*a(m+2)). - Kai Wang, Mar 03 2020
For 4 > h >= 0, k >= 0, a(4*k+h) mod 5 = a(h) mod 5. - Kai Wang, May 07 2020
From Kengbo Lu, Jul 27 2020: (Start)
a(n) = 1 + Sum_{k=0..n-1} a(k) if n odd; a(n) = Sum_{k=0..n-1} a(k) if n even.
a(n) = F(n) + Sum_{k=0..n-2} a(k)*F(n-k-1), where F denotes the Fibonacci numbers.
a(n) = b(n) + Sum_{k=0..n-1} a(k)*b(n-k), where b(n) is defined through b(0) = 0, b(1) = 1, b(n) = 2*b(n-2).
a(n) = 1 + 2*Sum_{k=0..n-2} a(k).
a(m+n) = a(m)*a(n+1) + 2*a(m-1)*a(n).
a(2*n) = Sum_{i>=0, j>=0} binomial(n-j-1,i)*binomial(n-i-1,j)*2^(i+j). (End)
G.f.: x/(1 - x - 2*x^2) = Sum_{n >= 0} x^(n+1) * Product_{k = 1..n} (k + 2*x)/(1 + k*x) (a telescoping series). - Peter Bala, May 08 2024
a(n) = Sum_{r>=0} F(n-2r, r), where F(n, 0) is the n-th Fibonacci number and F(n,r) = Sum_{j=1..n} F(n+1-j, r-1) F(j, r-1). - Gregory L. Simay, Aug 31 2024
From Peter Bala, Jun 27 2025: (Start)
The following are all examples of telescoping infinite products:
Product_{n >= 1} (1 + 2^n/a(2*n+2)) = 2, since 1 + 2^n/a(2*n+2) = b(n+1)/b(n), where b(n) = 2 - 3/(2^n + 1).
Product_{n >= 1} (1 - 2^n/a(2*n+2)) = 2/5, since 1 - 2^n/a(2*n+2) = c(n+1)/c(n), where c(n) = 2 + 3/(2^n - 1).
Product_{n >= 1} (1 + (-2)^n/a(2*n+2)) = 2/3, since 1 + (-2)^n/a(2*n+2) = d(n+1)/d(n), where d(n) = 2 - 1/(1 + (-2)^n).
Product_{n >= 1} (1 - (-2)^n/a(2*n+2)) = 6/5, since 1 - (-2)^n/a(2*n+2) = e(n+1)/e(n), where e(n) = 2 - 1/(1 - (-2)^n). (End)

Extensions

Thanks to Don Knuth, who pointed out several missing references, including Brocard (1880), which although it was mentioned in the 1973 Handbook of Integer Sequences, was omitted from the 1995 "Encyclopedia". - N. J. A. Sloane, Dec 26 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)

A000670 Fubini numbers: number of preferential arrangements of n labeled elements; or number of weak orders on n labeled elements; or number of ordered partitions of [n].

Original entry on oeis.org

1, 1, 3, 13, 75, 541, 4683, 47293, 545835, 7087261, 102247563, 1622632573, 28091567595, 526858348381, 10641342970443, 230283190977853, 5315654681981355, 130370767029135901, 3385534663256845323, 92801587319328411133, 2677687796244384203115, 81124824998504073881821
Offset: 0

Views

Author

Keywords

Comments

Number of ways n competitors can rank in a competition, allowing for the possibility of ties.
Also number of asymmetric generalized weak orders on n points.
Also called the ordered Bell numbers.
A weak order is a relation that is transitive and complete.
Called Fubini numbers by Comtet: counts formulas in Fubini theorem when switching the order of summation in multiple sums. - Olivier Gérard, Sep 30 2002 [Named after the Italian mathematician Guido Fubini (1879-1943). - Amiram Eldar, Jun 17 2021]
If the points are unlabeled then the answer is a(0) = 1, a(n) = 2^(n-1) (cf. A011782).
For n>0, a(n) is the number of elements in the Coxeter complex of type A_{n-1}. The corresponding sequence for type B is A080253 and there one can find a worked example as well as a geometric interpretation. - Tim Honeywill and Paul Boddington, Feb 10 2003
Also number of labeled (1+2)-free posets. - Detlef Pauly, May 25 2003
Also the number of chains of subsets starting with the empty set and ending with a set of n distinct objects. - Andrew Niedermaier, Feb 20 2004
From Michael Somos, Mar 04 2004: (Start)
Stirling transform of A007680(n) = [3,10,42,216,...] gives [3,13,75,541,...].
Stirling transform of a(n) = [1,3,13,75,...] is A083355(n) = [1,4,23,175,...].
Stirling transform of A000142(n) = [1,2,6,24,120,...] is a(n) = [1,3,13,75,...].
Stirling transform of A005359(n-1) = [1,0,2,0,24,0,...] is a(n-1) = [1,1,3,13,75,...].
Stirling transform of A005212(n-1) = [0,1,0,6,0,120,0,...] is a(n-1) = [0,1,3,13,75,...].
(End)
Unreduced denominators in convergent to log(2) = lim_{n->infinity} n*a(n-1)/a(n).
a(n) is congruent to a(n+(p-1)p^(h-1)) (mod p^h) for n >= h (see Barsky).
Stirling-Bernoulli transform of 1/(1-x^2). - Paul Barry, Apr 20 2005
This is the sequence of moments of the probability distribution of the number of tails before the first head in a sequence of fair coin tosses. The sequence of cumulants of the same probability distribution is A000629. That sequence is twice the result of deletion of the first term of this sequence. - Michael Hardy (hardy(AT)math.umn.edu), May 01 2005
With p(n) = the number of integer partitions of n, p(i) = the number of parts of the i-th partition of n, d(i) = the number of different 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, one has: a(n) = Sum_{i=1..p(n)} (n!/(Product_{j=1..p(i)} p(i,j)!)) * (p(i)!/(Product_{j=1..d(i)} m(i,j)!)). - Thomas Wieder, May 18 2005
The number of chains among subsets of [n]. The summed term in the new formula is the number of such chains of length k. - Micha Hofri (hofri(AT)wpi.edu), Jul 01 2006
Occurs also as first column of a matrix-inversion occurring in a sum-of-like-powers problem. Consider the problem for any fixed natural number m>2 of finding solutions to the equation Sum_{k=1..n} k^m = (k+1)^m. Erdős conjectured that there are no solutions for n, m > 2. Let D be the matrix of differences of D[m,n] := Sum_{k=1..n} k^m - (k+1)^m. Then the generating functions for the rows of this matrix D constitute a set of polynomials in n (for varying n along columns) and the m-th polynomial defining the m-th row. Let GF_D be the matrix of the coefficients of this set of polynomials. Then the present sequence is the (unsigned) first column of GF_D^-1. - Gottfried Helms, Apr 01 2007
Assuming A = log(2), D is d/dx and f(x) = x/(exp(x)-1), we have a(n) = (n!/2*A^(n+1)) Sum_{k=0..n} (A^k/k!) D^n f(-A) which gives Wilf's asymptotic value when n tends to infinity. Equivalently, D^n f(-a) = 2*( A*a(n) - 2*a(n-1) ). - Martin Kochanski (mjk(AT)cardbox.com), May 10 2007
List partition transform (see A133314) of (1,-1,-1,-1,...). - Tom Copeland, Oct 24 2007
First column of A154921. - Mats Granvik, Jan 17 2009
A slightly more transparent interpretation of a(n) is as the number of 'factor sequences' of N for the case in which N is a product of n distinct primes. A factor sequence of N of length k is of the form 1 = x(1), x(2), ..., x(k) = N, where {x(i)} is an increasing sequence such that x(i) divides x(i+1), i=1,2,...,k-1. For example, N=70 has the 13 factor sequences {1,70}, {1,2,70}, {1,5,70}, {1,7,70}, {1,10,70}, {1,14,70}, {1,35,70}, {1,2,10,70}, {1,2,14,70}, {1,5,10,70}, {1,5,35,70}, {1,7,14,70}, {1,7,35,70}. - Martin Griffiths, Mar 25 2009
Starting (1, 3, 13, 75, ...) = row sums of triangle A163204. - Gary W. Adamson, Jul 23 2009
Equals double inverse binomial transform of A007047: (1, 3, 11, 51, ...). - Gary W. Adamson, Aug 04 2009
If f(x) = Sum_{n>=0} c(n)*x^n converges for every x, then Sum_{n>=0} f(n*x)/2^(n+1) = Sum_{n>=0} c(n)*a(n)*x^n. Example: Sum_{n>=0} exp(n*x)/2^(n+1) = Sum_{n>=0} a(n)*x^n/n! = 1/(2-exp(x)) = e.g.f. - Miklos Kristof, Nov 02 2009
Hankel transform is A091804. - Paul Barry, Mar 30 2010
It appears that the prime numbers greater than 3 in this sequence (13, 541, 47293, ...) are of the form 4n+1. - Paul Muljadi, Jan 28 2011
The Fi1 and Fi2 triangle sums of A028246 are given by the terms of this sequence. For the definitions of these triangle sums, see A180662. - Johannes W. Meijer, Apr 20 2011
The modified generating function A(x) = 1/(2-exp(x))-1 = x + 3*x^2/2! + 13*x^3/3! + ... satisfies the autonomous differential equation A' = 1 + 3*A + 2*A^2 with initial condition A(0) = 0. Applying [Bergeron et al., Theorem 1] leads to two combinatorial interpretations for this sequence: (A) a(n) gives the number of plane-increasing 0-1-2 trees on n vertices, where vertices of outdegree 1 come in 3 colors and vertices of outdegree 2 come in 2 colors. (B) a(n) gives the number of non-plane-increasing 0-1-2 trees on n vertices, where vertices of outdegree 1 come in 3 colors and vertices of outdegree 2 come in 4 colors. Examples are given below. - Peter Bala, Aug 31 2011
Starting with offset 1 = the eigensequence of A074909 (the beheaded Pascal's triangle), and row sums of triangle A208744. - Gary W. Adamson, Mar 05 2012
a(n) = number of words of length n on the alphabet of positive integers for which the letters appearing in the word form an initial segment of the positive integers. Example: a(2) = 3 counts 11, 12, 21. The map "record position of block containing i, 1<=i<=n" is a bijection from lists of sets on [n] to these words. (The lists of sets on [2] are 12, 1/2, 2/1.) - David Callan, Jun 24 2013
This sequence was the subject of one of the earliest uses of the database. Don Knuth, who had a computer printout of the database prior to the publication of the 1973 Handbook, wrote to N. J. A. Sloane on May 18, 1970, saying: "I have just had my first real 'success' using your index of sequences, finding a sequence treated by Cayley that turns out to be identical to another (a priori quite different) sequence that came up in connection with computer sorting." A000670 is discussed in Exercise 3 of Section 5.3.1 of The Art of Computer Programming, Vol. 3, 1973. - N. J. A. Sloane, Aug 21 2014
Ramanujan gives a method of finding a continued fraction of the solution x of an equation 1 = x + a2*x^2 + ... and uses log(2) as the solution of 1 = x + x^2/2 + x^3/6 + ... as an example giving the sequence of simplified convergents as 0/1, 1/1, 2/3, 9/13, 52/75, 375/541, ... of which the sequence of denominators is this sequence, while A052882 is the numerators. - Michael Somos, Jun 19 2015
For n>=1, a(n) is the number of Dyck paths (A000108) with (i) n+1 peaks (UD's), (ii) no UUDD's, and (iii) at least one valley vertex at every nonnegative height less than the height of the path. For example, a(2)=3 counts UDUDUD (of height 1 with 2 valley vertices at height 0), UDUUDUDD, UUDUDDUD. These paths correspond, under the "glove" or "accordion" bijection, to the ordered trees counted by Cayley in the 1859 reference, after a harmless pruning of the "long branches to a leaf" in Cayley's trees. (Cayley left the reader to infer the trees he was talking about from examples for small n and perhaps from his proof.) - David Callan, Jun 23 2015
From David L. Harden, Apr 09 2017: (Start)
Fix a set X and define two distance functions d,D on X to be metrically equivalent when d(x_1,y_1) <= d(x_2,y_2) iff D(x_1,y_1) <= D(x_2,y_2) for all x_1, y_1, x_2, y_2 in X.
Now suppose that we fix a function f from unordered pairs of distinct elements of X to {1,...,n}. Then choose positive real numbers d_1 <= ... <= d_n such that d(x,y) = d_{f(x,y)}; the set of all possible choices of the d_i's makes this an n-parameter family of distance functions on X. (The simplest example of such a family occurs when n is a triangular number: When that happens, write n = (k 2). Then the set of all distance functions on X, when |X| = k, is such a family.) The number of such distance functions, up to metric equivalence, is a(n).
It is easy to see that an equivalence class of distance functions gives rise to a well-defined weak order on {d_1, ..., d_n}. To see that any weak order is realizable, choose distances from the set of integers {n-1, ..., 2n-2} so that the triangle inequality is automatically satisfied. (End)
a(n) is the number of rooted labeled forests on n nodes that avoid the patterns 213, 312, and 321. - Kassie Archer, Aug 30 2018
From A.H.M. Smeets, Nov 17 2018: (Start)
Also the number of semantic different assignments to n variables (x_1, ..., x_n) including simultaneous assignments. From the example given by Joerg Arndt (Mar 18 2014), this is easily seen by replacing
"{i}" by "x_i := expression_i(x_1, ..., x_n)",
"{i, j}" by "x_i, x_j := expression_i(x_1, .., x_n), expression_j(x_1, ..., x_n)", i.e., simultaneous assignment to two different variables (i <> j),
similar for simultaneous assignments to more variables, and
"<" by ";", i.e., the sequential constructor. These examples are directly related to "Number of ways n competitors can rank in a competition, allowing for the possibility of ties." in the first comment.
From this also the number of different mean definitions as obtained by iteration of n different mean functions on n initial values. Examples:
the AGM(x1,x2) = AGM(x2,x1) is represented by {arithmetic mean, geometric mean}, i.e., simultaneous assignment in any iteration step;
Archimedes's scheme (for Pi) is represented by {geometric mean} < {harmonic mean}, i.e., sequential assignment in any iteration step;
the geometric mean of two values can also be observed by {arithmetic mean, harmonic mean};
the AGHM (as defined in A319215) is represented by {arithmetic mean, geometric mean, harmonic mean}, i.e., simultaneous assignment, but there are 12 other semantic different ways to assign the values in an AGHM scheme.
By applying power means (also called Holder means) this can be extended to any value of n. (End)
Total number of faces of all dimensions in the permutohedron of order n. For example, the permutohedron of order 3 (a hexagon) has 6 vertices + 6 edges + 1 2-face = 13 faces, and the permutohedron of order 4 (a truncated octahedron) has 24 vertices + 36 edges + 14 2-faces + 1 3-face = 75 faces. A001003 is the analogous sequence for the associahedron. - Noam Zeilberger, Dec 08 2019
Number of odd multinomial coefficients N!/(a_1!*a_2!*...*a_k!). Here each a_i is positive, and Sum_{i} a_i = N (so 2^{N-1} multinomial coefficients in all), where N is any positive integer whose binary expansion has n 1's. - Richard Stanley, Apr 05 2022 (edited Oct 19 2022)
From Peter Bala, Jul 08 2022: (Start)
Conjecture: Let k be a positive integer. The sequence obtained by reducing a(n) modulo k is eventually periodic with the period dividing phi(k) = A000010(k). For example, modulo 16 we obtain the sequence [1, 1, 3, 13, 11, 13, 11, 13, 11, 13, ...], with an apparent period of 2 beginning at a(4). Cf. A354242.
More generally, we conjecture that the same property holds for integer sequences having an e.g.f. of the form G(exp(x) - 1), where G(x) is an integral power series. (End)
a(n) is the number of ways to form a permutation of [n] and then choose a subset of its descent set. - Geoffrey Critzer, Apr 29 2023
This is the Akiyama-Tanigawa transform of A000079, the powers of two. - Shel Kaphan, May 02 2024

Examples

			Let the points be labeled 1,2,3,...
a(2) = 3: 1<2, 2<1, 1=2.
a(3) = 13 from the 13 arrangements: 1<2<3, 1<3<2, 2<1<3, 2<3<1, 3<1<2, 3<2<1, 1=2<3 1=3<2, 2=3<1, 1<2=3, 2<1=3, 3<1=2, 1=2=3.
Three competitors can finish in 13 ways: 1,2,3; 1,3,2; 2,1,3; 2,3,1; 3,1,2; 3,2,1; 1,1,3; 2,2,1; 1,3,1; 2,1,2; 3,1,1; 1,2,2; 1,1,1.
a(3) = 13. The 13 plane increasing 0-1-2 trees on 3 vertices, where vertices of outdegree 1 come in 3 colors and vertices of outdegree 2 come in 2 colors, are:
........................................................
........1 (x3 colors).....1(x2 colors)....1(x2 colors)..
........|................/.\............./.\............
........2 (x3 colors)...2...3...........3...2...........
........|...............................................
........3...............................................
......====..............====............====............
.Totals 9......+..........2....+..........2....=..13....
........................................................
a(4) = 75. The 75 non-plane increasing 0-1-2 trees on 4 vertices, where vertices of outdegree 1 come in 3 colors and vertices of outdegree 2 come in 4 colors, are:
...............................................................
.....1 (x3).....1(x4).......1(x4).....1(x4)........1(x3).......
.....|........./.\........./.\......./.\...........|...........
.....2 (x3)...2...3.(x3)..3...2(x3).4...2(x3)......2(x4).......
.....|.............\...........\.........\......../.\..........
.....3.(x3).........4...........4.........3......3...4.........
.....|.........................................................
.....4.........................................................
....====......=====........====......====.........====.........
Tots 27....+....12......+...12....+...12.......+...12...=...75.
From _Joerg Arndt_, Mar 18 2014: (Start)
The a(3) = 13 strings on the alphabet {1,2,3} containing all letters up to the maximal value appearing and the corresponding ordered set partitions are:
01:  [ 1 1 1 ]     { 1, 2, 3 }
02:  [ 1 1 2 ]     { 1, 2 } < { 3 }
03:  [ 1 2 1 ]     { 1, 3 } < { 2 }
04:  [ 2 1 1 ]     { 2, 3 } < { 1 }
05:  [ 1 2 2 ]     { 1 } < { 2, 3 }
06:  [ 2 1 2 ]     { 2 } < { 1, 3 }
07:  [ 2 2 1 ]     { 3 } < { 1, 2 }
08:  [ 1 2 3 ]     { 1 } < { 2 } < { 3 }
09:  [ 1 3 2 ]     { 1 } < { 3 } < { 2 }
00:  [ 2 1 3 ]     { 2 } < { 1 } < { 3 }
11:  [ 2 3 1 ]     { 3 } < { 1 } < { 2 }
12:  [ 3 1 2 ]     { 2 } < { 3 } < { 1 }
13:  [ 3 2 1 ]     { 3 } < { 2 } < { 1 }
(End)
		

References

  • Mohammad K. Azarian, Geometric Series, Problem 329, Mathematics and Computer Education, Vol. 30, No. 1, Winter 1996, p. 101. Solution published in Vol. 31, No. 2, Spring 1997, pp. 196-197.
  • Norman Biggs, E. Keith Lloyd and Robin J. Wilson, Graph Theory 1736-1936, Oxford, 1976, p. 44 (P(x)).
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 183 (see R_n).
  • Kenneth S. Brown, Buildings, Springer-Verlag, 1988.
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 228.
  • Jean-Marie De Koninck, Ces nombres qui nous fascinent, Entry 13, pp 4, Ellipses, Paris 2008.
  • P. J. Freyd, On the size of Heyting semi-lattices, preprint, 2002.
  • Ian P. Goulden and David M. Jackson, Combinatorial Enumeration, John Wiley and Sons, N.Y., 1983.
  • Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 2nd Ed., 1994, exercise 7.44 (pp. 378, 571).
  • Silvia Heubach and Toufik Mansour, Combinatorics of Compositions and Words, CRC Press, 2010.
  • Donald E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, 1973, Section 5.3.1, Problem 3.
  • M. Muresan, Generalized Fubini numbers, Stud. Cerc. Mat., Vol. 37, No. 1 (1985), pp. 70-76.
  • Paul Peart, Hankel determinants via Stieltjes matrices. Proceedings of the Thirty-first Southeastern International Conference on Combinatorics, Graph Theory and Computing (Boca Raton, FL, 2000). Congr. Numer. 144 (2000), 153-159.
  • S. Ramanujan, Notebooks, Tata Institute of Fundamental Research, Bombay 1957 Vol. 1, see page 19.
  • Ulrike Sattler, Decidable classes of formal power series with nice closure properties, Diplomarbeit im Fach Informatik, Univ. Erlangen - Nuernberg, Jul 27 1994.
  • 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).
  • Richard P. Stanley, Enumerative Combinatorics, Wadsworth, Vol. 1, 1986; see Example 3.15.10, p. 146.
  • Jack van der Elsen, Black and White Transformations, Shaker Publishing, Maastricht, 2005, p. 18.

Crossrefs

See A240763 for a list of the actual preferential arrangements themselves.
A000629, this sequence, A002050, A032109, A052856, A076726 are all more-or-less the same sequence. - N. J. A. Sloane, Jul 04 2012
Binomial transform of A052841. Inverse binomial transform of A000629.
Asymptotic to A034172.
Row r=1 of A094416. Row 0 of array in A226513. Row n=1 of A262809.
Main diagonal of: A135313, A261781, A276890, A327245, A327583, A327584.
Row sums of triangles A019538, A131689, A208744 and A276891.
A217389 and A239914 give partial sums.
Column k=1 of A326322.

Programs

  • Haskell
    a000670 n = a000670_list !! n
    a000670_list = 1 : f [1] (map tail $ tail a007318_tabl) where
       f xs (bs:bss) = y : f (y : xs) bss where y = sum $ zipWith (*) xs bs
    -- Reinhard Zumkeller, Jul 26 2014
    
  • Magma
    R:=PowerSeriesRing(Rationals(), 40);
    Coefficients(R!(Laplace( 1/(2-Exp(x)) ))); // G. C. Greubel, Jun 11 2024
  • Maple
    A000670 := proc(n) option remember; local k; if n <=1 then 1 else add(binomial(n,k)*A000670(n-k),k=1..n); fi; end;
    with(combstruct); SeqSetL := [S, {S=Sequence(U), U=Set(Z,card >= 1)},labeled]; seq(count(SeqSetL,size=j),j=1..12);
    with(combinat): a:=n->add(add((-1)^(k-i)*binomial(k, i)*i^n, i=0..n), k=0..n): seq(a(n), n=0..18); # Zerinvary Lajos, Jun 03 2007
    a := n -> add(combinat:-eulerian1(n,k)*2^k,k=0..n): # Peter Luschny, Jan 02 2015
    a := n -> (polylog(-n, 1/2)+`if`(n=0,1,0))/2: seq(round(evalf(a(n),32)), n=0..20); # Peter Luschny, Nov 03 2015
    # next Maple program:
    b:= proc(n, k) option remember;
         `if`(n=0, k!, k*b(n-1, k)+b(n-1, k+1))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..20);  # Alois P. Heinz, Aug 04 2021
  • Mathematica
    Table[(PolyLog[-z, 1/2] + KroneckerDelta[z])/2, {z, 0, 20}] (* Wouter Meeussen *)
    a[0] = 1; a[n_]:= a[n]= Sum[Binomial[n, k]*a[n-k], {k, 1, n}]; Table[a[n], {n, 0, 30}] (* Roger L. Bagula and Gary W. Adamson, Sep 13 2008 *)
    t = 30; Range[0, t]! CoefficientList[Series[1/(2 - Exp[x]), {x, 0, t}], x] (* Vincenzo Librandi, Mar 16 2014 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ 1 / (2 - Exp@x), {x, 0, n}]]; (* Michael Somos, Jun 19 2015 *)
    Table[Sum[k^n/2^(k+1),{k,0,Infinity}],{n,0,20}] (* Vaclav Kotesovec, Jun 26 2015 *)
    Table[HurwitzLerchPhi[1/2, -n, 0]/2, {n, 0, 20}] (* Jean-François Alcover, Jan 31 2016 *)
    Fubini[n_, r_] := Sum[k!*Sum[(-1)^(i+k+r)*((i+r)^(n-r)/(i!*(k-i-r)!)), {i, 0, k-r}], {k, r, n}]; Fubini[0, 1] = 1; Table[Fubini[n, 1], {n, 0, 20}] (* Jean-François Alcover, Mar 31 2016 *)
    Eulerian1[0, 0] = 1; Eulerian1[n_, k_] := Sum[(-1)^j (k-j+1)^n Binomial[n+1, j], {j, 0, k+1}]; Table[Sum[Eulerian1[n, k] 2^k, {k, 0, n}], {n, 0, 20}] (* Jean-François Alcover, Jul 13 2019, after Peter Luschny *)
    Prepend[Table[-(-1)^k HurwitzLerchPhi[2, -k, 0]/2, {k, 1, 50}], 1] (* Federico Provvedi,Sep 05 2020 *)
    Table[Sum[k!*StirlingS2[n,k], {k, 0, n}], {n, 0, 20}] (* Vaclav Kotesovec, Nov 22 2020 *)
  • Maxima
    makelist(sum(stirling2(n,k)*k!,k,0,n),n,0,12); /* Emanuele Munarini, Jul 07 2011 */
    
  • Maxima
    a[0]:1$ a[n]:=sum(binomial(n,k)*a[n-k],k,1,n)$ A000670(n):=a[n]$ makelist(A000670(n),n,0,30); /* Martin Ettl, Nov 05 2012 */
    
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( subst( 1 / (1 - y), y, exp(x + x*O(x^n)) - 1), n))}; /* Michael Somos, Mar 04 2004 */
    
  • PARI
    Vec(serlaplace(1/(2-exp('x+O('x^66))))) /* Joerg Arndt, Jul 10 2011 */
    
  • PARI
    {a(n)=polcoeff(sum(m=0,n,m!*x^m/prod(k=1,m,1-k*x+x*O(x^n))),n)} /* Paul D. Hanna, Jul 20 2011 */
    
  • PARI
    {a(n) = if( n<1, n==0, sum(k=1, n, binomial(n, k) * a(n-k)))}; /* Michael Somos, Jul 16 2017 */
    
  • Python
    from math import factorial
    from sympy.functions.combinatorial.numbers import stirling
    def A000670(n): return sum(factorial(k)*stirling(n,k) for k in range(n+1)) # Chai Wah Wu, Nov 08 2022
    
  • Sage
    @CachedFunction
    def A000670(n) : return 1 if n == 0 else add(A000670(k)*binomial(n,k) for k in range(n))
    [A000670(n) for n in (0..20)] # Peter Luschny, Jul 14 2012
    

Formula

a(n) = Sum_{k=0..n} k! * StirlingS2(n,k) (whereas the Bell numbers A000110(n) = Sum_{k=0..n} StirlingS2(n,k)).
E.g.f.: 1/(2-exp(x)).
a(n) = Sum_{k=1..n} binomial(n, k)*a(n-k), a(0) = 1.
The e.g.f. y(x) satisfies y' = 2*y^2 - y.
a(n) = A052856(n) - 1, if n>0.
a(n) = A052882(n)/n, if n>0.
a(n) = A076726(n)/2.
a(n) is asymptotic to (1/2)*n!*log_2(e)^(n+1), where log_2(e) = 1.442695... [Barthelemy80, Wilf90].
For n >= 1, a(n) = (n!/2) * Sum_{k=-infinity..infinity} of (log(2) + 2 Pi i k)^(-n-1). - Dean Hickerson
a(n) = ((x*d/dx)^n)(1/(2-x)) evaluated at x=1. - Karol A. Penson, Sep 24 2001
For n>=1, a(n) = Sum_{k>=1} (k-1)^n/2^k = A000629(n)/2. - Benoit Cloitre, Sep 08 2002
Value of the n-th Eulerian polynomial (cf. A008292) at x=2. - Vladeta Jovovic, Sep 26 2003
First Eulerian transform of the powers of 2 [A000079]. See A000142 for definition of FET. - Ross La Haye, Feb 14 2005
a(n) = Sum_{k=0..n} (-1)^k*k!*Stirling2(n+1, k+1)*(1+(-1)^k)/2. - Paul Barry, Apr 20 2005
a(n) + a(n+1) = 2*A005649(n). - Philippe Deléham, May 16 2005 - Thomas Wieder, May 18 2005
Equals inverse binomial transform of A000629. - Gary W. Adamson, May 30 2005
a(n) = Sum_{k=0..n} k!*( Stirling2(n+2, k+2) - Stirling2(n+1, k+2) ). - Micha Hofri (hofri(AT)wpi.edu), Jul 01 2006
Recurrence: 2*a(n) = (a+1)^n where superscripts are converted to subscripts after binomial expansion - reminiscent of Bernoulli numbers' B_n = (B+1)^n. - Martin Kochanski (mjk(AT)cardbox.com), May 10 2007
a(n) = (-1)^n * n! * Laguerre(n,P((.),2)), umbrally, where P(j,t) are the polynomials in A131758. - Tom Copeland, Sep 27 2007
Formula in terms of the hypergeometric function, in Maple notation: a(n) = hypergeom([2,2...2],[1,1...1],1/2)/4, n=1,2..., where in the hypergeometric function there are n upper parameters all equal to 2 and n-1 lower parameters all equal to 1 and the argument is equal to 1/2. Example: a(4) = evalf(hypergeom([2,2,2,2],[1,1,1],1/2)/4) = 75. - Karol A. Penson, Oct 04 2007
a(n) = Sum_{k=0..n} A131689(n,k). - Philippe Deléham, Nov 03 2008
From Peter Bala, Jul 01 2009: (Start)
Analogy with the Bernoulli numbers.
We enlarge upon the above comment of M. Kochanski.
The Bernoulli polynomials B_n(x), n = 0,1,..., are given by the formula
(1)... B_n(x) := Sum_{k=0..n} binomial(n,k)*B(k)*x^(n-k),
where B(n) denotes the sequence of Bernoulli numbers B(0) = 1,
B(1) = -1/2, B(2) = 1/6, B(3) = 0, ....
By analogy, we associate with the present sequence an Appell sequence of polynomials {P_n(x)} n >= 0 defined by
(2)... P_n(x) := Sum_{k=0..n} binomial(n,k)*a(k)*x^(n-k).
These polynomials have similar properties to the Bernoulli polynomials.
The first few values are P_0(x) = 1, P_1(x) = x + 1,
P_2(x) = x^2 + 2*x + 3, P_3(x) = x^3 + 3*x^2 + 9*x + 13 and
P_4(x) = x^4 + 4*x^3 + 18*x^2 + 52*x + 75. See A154921 for the triangle of coefficients of these polynomials.
The e.g.f. for this polynomial sequence is
(3)... exp(x*t)/(2 - exp(t)) = 1 + (x + 1)*t + (x^2 + 2*x + 3)*t^2/2! + ....
The polynomials satisfy the difference equation
(4)... 2*P_n(x - 1) - P_n(x) = (x - 1)^n,
and so may be used to evaluate the weighted sums of powers of integers
(1/2)*1^m + (1/2)^2*2^m + (1/2)^3*3^m + ... + (1/2)^(n-1)*(n-1)^m
via the formula
(5)... Sum_{k=1..n-1} (1/2)^k*k^m = 2*P_m(0) - (1/2)^(n-1)*P_m(n),
analogous to the evaluation of the sums 1^m + 2^m + ... + (n-1)^m in terms of Bernoulli polynomials.
This last result can be generalized to
(6)... Sum_{k=1..n-1} (1/2)^k*(k+x)^m = 2*P_m(x)-(1/2)^(n-1)*P_m(x+n).
For more properties of the polynomials P_n(x), refer to A154921.
For further information on weighted sums of powers of integers and the associated polynomial sequences, see A162312.
The present sequence also occurs in the evaluation of another sum of powers of integers. Define
(7)... S_m(n) := Sum_{k=1..n-1} (1/2)^k*((n-k)*k)^m, m = 1,2,....
Then
(8)... S_m(n) = (-1)^m *[2*Q_m(-n) - (1/2)^(n-1)*Q_m(n)],
where Q_m(x) are polynomials in x given by
(9)... Q_m(x) = Sum_{k=0..m} a(m+k)*binomial(m,k)*x^(m-k).
The first few values are Q_1(x) = x + 3, Q_2(x) = 3*x^2 + 26*x + 75
and Q_3(x) = 13*x^3 + 225*x^2 + 1623*x + 4683.
For example, m = 2 gives
(10)... S_2(n) := Sum_{k=1..n-1} (1/2)^k*((n-k)*k)^2
= 2*(3*n^2 - 26*n + 75) - (1/2)^(n-1)*(3*n^2 + 26*n + 75).
(End)
G.f.: 1/(1-x/(1-2*x/(1-2*x/(1-4*x/(1-3*x/(1-6*x/(1-4*x/(1-8*x/(1-5*x/(1-10*x/(1-6*x/(1-... (continued fraction); coefficients of continued fraction are given by floor((n+2)/2)*(3-(-1)^n)/2 (A029578(n+2)). - Paul Barry, Mar 30 2010
G.f.: 1/(1-x-2*x^2/(1-4*x-8*x^2/(1-7*x-18*x^2/(1-10*x-32*x^2/(1../(1-(3*n+1)*x-2*(n+1)^2*x^2/(1-... (continued fraction). - Paul Barry, Jun 17 2010
G.f.: A(x) = Sum_{n>=0} n!*x^n / Product_{k=1..n} (1-k*x). - Paul D. Hanna, Jul 20 2011
a(n) = A074206(q_1*q_2*...*q_n), where {q_i} are distinct primes. - Vladimir Shevelev, Aug 05 2011
The adjusted e.g.f. A(x) := 1/(2-exp(x))-1, has inverse function A(x)^-1 = Integral_{t=0..x} 1/((1+t)*(1+2*t)). Applying [Dominici, Theorem 4.1] to invert the integral yields a formula for a(n): Let f(x) = (1+x)*(1+2*x). Let D be the operator f(x)*d/dx. Then a(n) = D^(n-1)(f(x)) evaluated at x = 0. Compare with A050351. - Peter Bala, Aug 31 2011
a(n) = D^n*(1/(1-x)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A052801. - Peter Bala, Nov 25 2011
From Sergei N. Gladkovskii, from Oct 2011 to Oct 2013: (Start)
Continued fractions:
G.f.: 1+x/(1-x+2*x*(x-1)/(1+3*x*(2*x-1)/(1+4*x*(3*x-1)/(1+5*x*(4*x-1)/(1+... or 1+x/(U(0)-x), U(k) = 1+(k+2)*(k*x+x-1)/U(k+1).
E.g.f.: 1 + x/(G(0)-2*x) where G(k) = x + k + 1 - x*(k+1)/G(k+1).
E.g.f. (2 - 2*x)*(1 - 2*x^3/(8*x^2 - 4*x + (x^2 - 4*x + 2)*G(0)))/(x^2 - 4*x + 2) where G(k) = k^2 + k*(x+4) + 2*x + 3 - x*(k+1)*(k+3)^2 /G(k+1).
G.f.: 1 + x/G(0) where G(k) = 1 - 3*x*(k+1) - 2*x^2*(k+1)*(k+2)/G(k+1).
G.f.: 1/G(0) where G(k) = 1 - x*(k+1)/( 1 - 2*x*(k+1)/G(k+1) ).
G.f.: 1 + x/Q(0), where Q(k) = 1 - 3*x*(2*k+1) - 2*x^2*(2*k+1)*(2*k+2)/( 1 - 3*x*(2*k+2) - 2*x^2*(2*k+2)*(2*k+3)/Q(k+1) ).
G.f.: T(0)/(1-x), where T(k) = 1 - 2*x^2*(k+1)^2/( 2*x^2*(k+1)^2 - (1-x-3*x*k)*(1-4*x-3*x*k)/T(k+1) ). (End)
a(n) is always odd. For odd prime p and n >= 1, a((p-1)*n) = 0 (mod p). - Peter Bala, Sep 18 2013
a(n) = log(2)* Integral_{x>=0} floor(x)^n * 2^(-x) dx. - Peter Bala, Feb 06 2015
For n > 0, a(n) = Re(polygamma(n, i*log(2)/(2*Pi))/(2*Pi*i)^(n+1)) - n!/(2*log(2)^(n+1)). - Vladimir Reshetnikov, Oct 15 2015
a(n) = Sum_{k=1..n} (k*b2(k-1)*(k)!*Stirling2(n, k)), n>0, a(0)=1, where b2(n) is the n-th Bernoulli number of the second kind. - Vladimir Kruchinin, Nov 21 2016
Conjecture: a(n) = Sum_{k=0..2^(n-1)-1} A284005(k) for n > 0 with a(0) = 1. - Mikhail Kurkov, Jul 08 2018
a(n) = A074206(k) for squarefree k with n prime factors. In particular a(n) = A074206(A002110(n)). - Amiram Eldar, May 13 2019
For n > 0, a(n) = -(-1)^n / 2 * PHI(2, -n, 0), where PHI(z, s, a) is the Lerch zeta function. - Federico Provvedi, Sep 05 2020
a(n) = Sum_{s in S_n} Product_{i=1..n} binomial(i,s(i)-1), where s ranges over the set S_n of permutations of [n]. - Jose A. Rodriguez, Feb 02 2021
Sum_{n>=0} 1/a(n) = 2.425674839121428857970063350500499393706641093287018840857857170864211946122664... - Vaclav Kotesovec, Jun 17 2021
From Jacob Sprittulla, Oct 05 2021: (Start)
The following identities hold for sums over Stirling numbers of the second kind with even or odd second argument:
a(n) = 2 * Sum_{k=0..floor(n/2)} ((2k)! * Stirling2(n,2*k) ) - (-1)^n = 2*A052841-(-1)^n
a(n) = 2 * Sum_{k=0..floor(n/2)} ((2k+1)!* Stirling2(n,2*k+1))+ (-1)^n = 2*A089677+(-1)^n
a(n) = Sum_{k=1..floor((n+1)/2)} ((2k-1)!* Stirling2(n+1,2*k))
a(n) = Sum_{k=0..floor((n+1)/2)} ((2k)! * Stirling2(n+1,2*k+1)). (End)

A000330 Square pyramidal numbers: a(n) = 0^2 + 1^2 + 2^2 + ... + n^2 = n*(n+1)*(2*n+1)/6.

Original entry on oeis.org

0, 1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015, 1240, 1496, 1785, 2109, 2470, 2870, 3311, 3795, 4324, 4900, 5525, 6201, 6930, 7714, 8555, 9455, 10416, 11440, 12529, 13685, 14910, 16206, 17575, 19019, 20540, 22140, 23821, 25585, 27434, 29370
Offset: 0

Views

Author

Keywords

Comments

The sequence contains exactly one square greater than 1, namely 4900 (according to Gardner). - Jud McCranie, Mar 19 2001, Mar 22 2007 [This is a result from Watson. - Charles R Greathouse IV, Jun 21 2013] [See A351830 for further related comments and references.]
Number of rhombi in an n X n rhombus. - Matti De Craene (Matti.DeCraene(AT)rug.ac.be), May 14 2000
Number of acute triangles made from the vertices of a regular n-polygon when n is odd (cf. A007290). - Sen-Peng Eu, Apr 05 2001
Gives number of squares with sides parallel to the axes formed from an n X n square. In a 1 X 1 square, one is formed. In a 2 X 2 square, five squares are formed. In a 3 X 3 square, 14 squares are formed and so on. - Kristie Smith (kristie10spud(AT)hotmail.com), Apr 16 2002; edited by Eric W. Weisstein, Mar 05 2025
a(n-1) = B_3(n)/3, where B_3(x) = x(x-1)(x-1/2) is the third Bernoulli polynomial. - Michael Somos, Mar 13 2004
Number of permutations avoiding 13-2 that contain the pattern 32-1 exactly once.
Since 3*r = (r+1) + r + (r-1) = T(r+1) - T(r-2), where T(r) = r-th triangular number r*(r+1)/2, we have 3*r^2 = r*(T(r+1) - T(r-2)) = f(r+1) - f(r-1) ... (i), where f(r) = (r-1)*T(r) = (r+1)*T(r-1). Summing over n, the right hand side of relation (i) telescopes to f(n+1) + f(n) = T(n)*((n+2) + (n-1)), whence the result Sum_{r=1..n} r^2 = n*(n+1)*(2*n+1)/6 immediately follows. - Lekraj Beedassy, Aug 06 2004
Also as a(n) = (1/6)*(2*n^3 + 3*n^2 + n), n > 0: structured trigonal diamond numbers (vertex structure 5) (cf. A006003 = alternate vertex; A000447 = structured diamonds; A100145 for more on structured numbers). - James A. Record (james.record(AT)gmail.com), Nov 07 2004
Number of triples of integers from {1, 2, ..., n} whose last component is greater than or equal to the others.
Kekulé numbers for certain benzenoids. - Emeric Deutsch, Jun 12 2005
Sum of the first n positive squares. - Cino Hilliard, Jun 18 2007
Maximal number of cubes of side 1 in a right pyramid with a square base of side n and height n. - Pasquale CUTOLO (p.cutolo(AT)inwind.it), Jul 09 2007
If a 2-set Y and an (n-2)-set Z are disjoint subsets of an n-set X then a(n-3) is the number of 4-subsets of X intersecting both Y and Z. - Milan Janjic, Sep 19 2007
We also have the identity 1 + (1+4) + (1+4+9) + ... + (1+4+9+16+ ... + n^2) = n(n+1)(n+2)(n+(n+1)+(n+2))/36; ... and in general the k-fold nested sum of squares can be expressed as n(n+1)...(n+k)(n+(n+1)+...+(n+k))/((k+2)!(k+1)/2). - Alexander R. Povolotsky, Nov 21 2007
The terms of this sequence are coefficients of the Engel expansion of the following converging sum: 1/(1^2) + (1/1^2)*(1/(1^2+2^2)) + (1/1^2)*(1/(1^2+2^2))*(1/(1^2+2^2+3^2)) + ... - Alexander R. Povolotsky, Dec 10 2007
Convolution of A000290 with A000012. - Sergio Falcon, Feb 05 2008
Hankel transform of binomial(2*n-3, n-1) is -a(n). - Paul Barry, Feb 12 2008
Starting (1, 5, 14, 30, ...) = binomial transform of [1, 4, 5, 2, 0, 0, 0, ...]. - Gary W. Adamson, Jun 13 2008
Starting (1,5,14,30,...) = second partial sums of binomial transform of [1,2,0,0,0,...]. a(n) = Sum_{i=0..n} binomial(n+2,i+2)*b(i), where b(i)=1,2,0,0,0,... - Borislav St. Borisov (b.st.borisov(AT)abv.bg), Mar 05 2009
Convolution of A001477 with A005408: a(n) = Sum_{k=0..n} (2*k+1)*(n-k). - Reinhard Zumkeller, Mar 07 2009
Sequence of the absolute values of the z^1 coefficients of the polynomials in the GF1 denominators of A156921. See A157702 for background information. - Johannes W. Meijer, Mar 07 2009
The sequence is related to A000217 by a(n) = n*A000217(n) - Sum_{i=0..n-1} A000217(i) and this is the case d = 1 in the identity n^2*(d*n-d+2)/2 - Sum_{i=0..n-1} i*(d*i-d+2)/2 = n*(n+1)(2*d*n-2*d+3)/6, or also the case d = 0 in n^2*(n+2*d+1)/2 - Sum_{i=0..n-1} i*(i+2*d+1)/2 = n*(n+1)*(2*n+3*d+1)/6. - Bruno Berselli, Apr 21 2010, Apr 03 2012
a(n)/n = k^2 (k = integer) for n = 337; a(337) = 12814425, a(n)/n = 38025, k = 195, i.e., the number k = 195 is the quadratic mean (root mean square) of the first 337 positive integers. There are other such numbers -- see A084231 and A084232. - Jaroslav Krizek, May 23 2010
Also the number of moves to solve the "alternate coins game": given 2n+1 coins (n+1 Black, n White) set alternately in a row (BWBW...BWB) translate (not rotate) a pair of adjacent coins at a time (1 B and 1 W) so that at the end the arrangement shall be BBBBB..BW...WWWWW (Blacks separated by Whites). Isolated coins cannot be moved. - Carmine Suriano, Sep 10 2010
From J. M. Bergot, Aug 23 2011: (Start)
Using four consecutive numbers n, n+1, n+2, and n+3 take all possible pairs (n, n+1), (n, n+2), (n, n+3), (n+1, n+2), (n+1, n+3), (n+2, n+3) to create unreduced Pythagorean triangles. The sum of all six areas is 60*a(n+1).
Using three consecutive odd numbers j, k, m, (j+k+m)^3 - (j^3 + k^3 + m^3) equals 576*a(n) = 24^2*a(n) where n = (j+1)/2. (End)
From Ant King, Oct 17 2012: (Start)
For n > 0, the digital roots of this sequence A010888(a(n)) form the purely periodic 27-cycle {1, 5, 5, 3, 1, 1, 5, 6, 6, 7, 2, 2, 9, 7, 7, 2, 3, 3, 4, 8, 8, 6, 4, 4, 8, 9, 9}.
For n > 0, the units' digits of this sequence A010879(a(n)) form the purely periodic 20-cycle {1, 5, 4, 0, 5, 1, 0, 4, 5, 5, 6, 0, 9, 5, 0, 6, 5, 9, 0, 0}. (End)
Length of the Pisano period of this sequence mod n, n>=1: 1, 4, 9, 8, 5, 36, 7, 16, 27, 20, 11, 72, 13, 28, 45, 32, 17, 108, 19, 40, ... . - R. J. Mathar, Oct 17 2012
Sum of entries of n X n square matrix with elements min(i,j). - Enrique Pérez Herrero, Jan 16 2013
The number of intersections of diagonals in the interior of regular n-gon for odd n > 1 divided by n is a square pyramidal number; that is, A006561(2*n+1)/(2*n+1) = A000330(n-1) = (1/6)*n*(n-1)*(2*n-1). - Martin Renner, Mar 06 2013
For n > 1, a(n)/(2n+1) = A024702(m), for n such that 2n+1 = prime, which results in 2n+1 = A000040(m). For example, for n = 8, 2n+1 = 17 = A000040(7), a(8) = 204, 204/17 = 12 = A024702(7). - Richard R. Forberg, Aug 20 2013
A formula for the r-th successive summation of k^2, for k = 1 to n, is (2*n+r)*(n+r)!/((r+2)!*(n-1)!) (H. W. Gould). - Gary Detlefs, Jan 02 2014
The n-th square pyramidal number = the n-th triangular dipyramidal number (Johnson 12), which is the sum of the n-th + (n-1)-st tetrahedral numbers. E.g., the 3rd tetrahedral number is 10 = 1+3+6, the 2nd is 4 = 1+3. In triangular "dipyramidal form" these numbers can be written as 1+3+6+3+1 = 14. For "square pyramidal form", rebracket as 1+(1+3)+(3+6) = 14. - John F. Richardson, Mar 27 2014
Beukers and Top prove that no square pyramidal number > 1 equals a tetrahedral number A000292. - Jonathan Sondow, Jun 21 2014
Odd numbered entries are related to dissections of polygons through A100157. - Tom Copeland, Oct 05 2014
From Bui Quang Tuan, Apr 03 2015: (Start)
We construct a number triangle from the integers 1, 2, 3, ..., n as follows. The first column contains 2*n-1 integers 1. The second column contains 2*n-3 integers 2, ... The last column contains only one integer n. The sum of all the numbers in the triangle is a(n).
Here is an example with n = 5:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
(End)
The Catalan number series A000108(n+3), offset 0, gives Hankel transform revealing the square pyramidal numbers starting at 5, A000330(n+2), offset 0 (empirical observation). - Tony Foster III, Sep 05 2016; see Dougherty et al. link p. 2. - Andrey Zabolotskiy, Oct 13 2016
Number of floating point additions in the factorization of an (n+1) X (n+1) real matrix by Gaussian elimination as e.g. implemented in LINPACK subroutines sgefa.f or dgefa.f. The number of multiplications is given by A007290. - Hugo Pfoertner, Mar 28 2018
The Jacobi polynomial P(n-1,-n+2,2,3) or equivalently the sum of dot products of vectors from the first n rows of Pascal's triangle (A007318) with the up-diagonal Chebyshev T coefficient vector (1,3,2,0,...) (A053120) or down-diagonal vector (1,-7,32,-120,400,...) (A001794). a(5) = 1 + (1,1).(1,3) + (1,2,1).(1,3,2) + (1,3,3,1).(1,3,2,0) + (1,4,6,4,1).(1,3,2,0,0) = (1 + (1,1).(1,-7) + (1,2,1).(1,-7,32) + (1,3,3,1).(1,-7,32,-120) + (1,4,6,4,1).(1,-7,32,-120,400))*(-1)^(n-1) = 55. - Richard Turk, Jul 03 2018
Coefficients in the terminating series identity 1 - 5*n/(n + 4) + 14*n*(n - 1)/((n + 4)*(n + 5)) - 30*n*(n - 1)*(n - 2)/((n + 4)*(n + 5)*(n + 6)) + ... = 0 for n = 1,2,3,.... Cf. A002415 and A108674. - Peter Bala, Feb 12 2019
n divides a(n) iff n == +- 1 (mod 6) (see A007310). (See De Koninck reference.) Examples: a(11) = 506 = 11 * 46, and a(13) = 819 = 13 * 63. - Bernard Schott, Jan 10 2020
For n > 0, a(n) is the number of ternary words of length n+2 having 3 letters equal to 2 and 0 only occurring as the last letter. For example, for n=2, the length 4 words are 2221,2212,2122,1222,2220. - Milan Janjic, Jan 28 2020
Conjecture: Every integer can be represented as a sum of three generalized square pyramidal numbers. A related conjecture is given in A336205 corresponding to pentagonal case. A stronger version of these conjectures is that every integer can be expressed as a sum of three generalized r-gonal pyramidal numbers for all r >= 3. In here "generalized" means negative indices are included. - Altug Alkan, Jul 30 2020
The natural number y is a term if and only if y = a(floor((3 * y)^(1/3))). - Robert Israel, Dec 04 2024
Also the number of directed bishop moves on an n X n chessboard, where two moves are considered the same if one can be obtained from the other by a rotation of the board. Reflections are ignored. Equivalently, number of directed bishop moves on an n X n chessboard, where two moves are considered the same if one can be obtained from the other by an axial reflection of the board (horizontal or vertical). Rotations and diagonal reflections are ignored. - Hilko Koning, Aug 22 2025

Examples

			G.f. = x + 5*x^2 + 14*x^3 + 30*x^4 + 55*x^5 + 91*x^6 + 140*x^7 + 204*x^8 + ...
		

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. 813.
  • A. H. Beiler, Recreations in the Theory of Numbers, Dover Publications, NY, 1964, p. 194.
  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 215,223.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 122, see #19 (3(1)), I(n); p. 155.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 47-49.
  • H. S. M. Coxeter, Polyhedral numbers, pp. 25-35 of R. S. Cohen, J. J. Stachel and M. W. Wartofsky, eds., For Dirk Struik: Scientific, historical and political essays in honor of Dirk J. Struik, Reidel, Dordrecht, 1974.
  • S. J. Cyvin and I. Gutman, Kekulé structures in benzenoid hydrocarbons, Lecture Notes in Chemistry, No. 46, Springer, New York, 1988 (p.165).
  • J. M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 310, pp. 46-196, Ellipses, Paris, 2004.
  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 93.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 2.
  • M. Gardner, Fractal Music, Hypercards and More, Freeman, NY, 1991, p. 293.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §8.6 Figurate Numbers, p. 293.
  • M. Holt, Math puzzles and games, Walker Publishing Company, 1977, p. 2 and p. 89.
  • Simon Singh, The Simpsons and Their Mathematical Secrets. London: Bloomsbury Publishing PLC (2013): 188.
  • 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).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 126.

Crossrefs

Sums of 2 consecutive terms give A005900.
Column 0 of triangle A094414.
Column 1 of triangle A008955.
Right side of triangle A082652.
Row 2 of array A103438.
Partial sums of A000290.
Cf. similar sequences listed in A237616 and A254142.
Cf. |A084930(n, 1)|.
Cf. A253903 (characteristic function).
Cf. A034705 (differences of any two terms).

Programs

  • GAP
    List([0..30], n-> n*(n+1)*(2*n+1)/6); # G. C. Greubel, Dec 31 2019
  • Haskell
    a000330 n = n * (n + 1) * (2 * n + 1) `div` 6
    a000330_list = scanl1 (+) a000290_list
    -- Reinhard Zumkeller, Nov 11 2012, Feb 03 2012
    
  • Magma
    [n*(n+1)*(2*n+1)/6: n in [0..50]]; // Wesley Ivan Hurt, Jun 28 2014
    
  • Magma
    [0] cat [((2*n+3)*Binomial(n+2,2))/3: n in [0..40]]; // Vincenzo Librandi, Jul 30 2014
    
  • Maple
    A000330 := n -> n*(n+1)*(2*n+1)/6;
    a := n->(1/6)*n*(n+1)*(2*n+1): seq(a(n),n=0..53); # Emeric Deutsch
    with(combstruct): ZL:=[st, {st=Prod(left, right), left=Set(U, card=r), right=Set(U, card=r), U=Sequence(Z, card>=1)}, unlabeled]: subs(r=1, stack): seq(count(subs(r=2, ZL), size=m*2), m=1..45) ; # Zerinvary Lajos, Jan 02 2008
    nmax := 44; for n from 0 to nmax do fz(n) := product( (1-(2*m-1)*z)^(n+1-m) , m=1..n); c(n) := abs(coeff(fz(n),z,1)); end do: a := n-> c(n): seq(a(n), n=0..nmax); # Johannes W. Meijer, Mar 07 2009
  • Mathematica
    Table[Binomial[w+2, 3] + Binomial[w+1, 3], {w, 0, 30}]
    CoefficientList[Series[x(1+x)/(1-x)^4, {x, 0, 40}], x] (* Vincenzo Librandi, Jul 30 2014 *)
    Accumulate[Range[0,50]^2] (* Harvey P. Dale, Sep 25 2014 *)
  • Maxima
    A000330(n):=binomial(n+2,3)+binomial(n+1,3)$
    makelist(A000330(n),n,0,20); /* Martin Ettl, Nov 12 2012 */
    
  • PARI
    {a(n) = n * (n+1) * (2*n+1) / 6};
    
  • PARI
    upto(n) = [x*(x+1)*(2*x+1)/6 | x<-[0..n]] \\ Cino Hilliard, Jun 18 2007, edited by M. F. Hasler, Jan 02 2024
    
  • Python
    a=lambda n: (n*(n+1)*(2*n+1))//6 # Indranil Ghosh, Jan 04 2017
    
  • Sage
    [n*(n+1)*(2*n+1)/6 for n in (0..30)] # G. C. Greubel, Dec 31 2019
    

Formula

G.f.: x*(1+x)/(1-x)^4. - Simon Plouffe (in his 1992 dissertation: generating function for sequence starting at a(1))
E.g.f.: (x + 3*x^2/2 + x^3/3)*exp(x).
a(n) = n*(n+1)*(2*n+1)/6 = binomial(n+2, 3) + binomial(n+1, 3).
2*a(n) = A006331(n). - N. J. A. Sloane, Dec 11 1999
Can be extended to Z with a(n) = -a(-1-n) for all n in Z.
a(n) = A002492(n)/4. - Paul Barry, Jul 19 2003
a(n) = (((n+1)^4 - n^4) - ((n+1)^2 - n^2))/12. - Xavier Acloque, Oct 16 2003
From Alexander Adamchuk, Oct 26 2004: (Start)
a(n) = sqrt(A271535(n)).
a(n) = (Sum_{k=1..n} Sum_{j=1..n} Sum_{i=1..n} (i*j*k)^2)^(1/3). (End)
a(n) = Sum_{i=1..n} i*(2*n-2*i+1); sum of squares gives 1 + (1+3) + (1+3+5) + ... - Jon Perry, Dec 08 2004
a(n+1) = A000217(n+1) + 2*A000292(n). - Creighton Dement, Mar 10 2005
Sum_{n>=1} 1/a(n) = 6*(3-4*log(2)); Sum_{n>=1} (-1)^(n+1)*1/a(n) = 6*(Pi-3). - Philippe Deléham, May 31 2005
Sum of two consecutive tetrahedral (or pyramidal) numbers a(n) = A000292(n-1) + A000292(n). - Alexander Adamchuk, May 17 2006
Euler transform of length-2 sequence [ 5, -1 ]. - Michael Somos, Sep 04 2006
a(n) = a(n-1) + n^2. - Rolf Pleisch, Jul 22 2007
a(n) = A132121(n,0). - Reinhard Zumkeller, Aug 12 2007
a(n) = binomial(n, 2) + 2*binomial(n, 3). - Borislav St. Borisov (b.st.borisov(AT)abv.bg), Mar 05 2009, corrected by M. F. Hasler, Jan 02 2024
a(n) = A168559(n) + 1 for n > 0. - Reinhard Zumkeller, Feb 03 2012
a(n) = Sum_{i=1..n} J_2(i)*floor(n/i), where J_2 is A007434. - Enrique Pérez Herrero, Feb 26 2012
a(n) = s(n+1, n)^2 - 2*s(n+1, n-1), where s(n, k) are Stirling numbers of the first kind, A048994. - Mircea Merca, Apr 03 2012
a(n) = A001477(n) + A000217(n) + A007290(n+2) + 1. - J. M. Bergot, May 31 2012
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) + 2. - Ant King, Oct 17 2012
a(n) = Sum_{i = 1..n} Sum_{j = 1..n} min(i,j). - Enrique Pérez Herrero, Jan 15 2013
a(n) = A000217(n) + A007290(n+1). - Ivan N. Ianakiev, May 10 2013
a(n) = (A047486(n+2)^3 - A047486(n+2))/24. - Richard R. Forberg, Dec 25 2013
a(n) = Sum_{i=0..n-1} (n-i)*(2*i+1), with a(0) = 0. After 0, row sums of the triangle in A101447. - Bruno Berselli, Feb 10 2014
a(n) = n + 1 + Sum_{i=1..n+1} (i^2 - 2i). - Wesley Ivan Hurt, Feb 25 2014
a(n) = A000578(n+1) - A002412(n+1). - Wesley Ivan Hurt, Jun 28 2014
a(n) = Sum_{i = 1..n} Sum_{j = i..n} max(i,j). - Enrique Pérez Herrero, Dec 03 2014
a(n) = A055112(n)/6, see Singh (2013). - Alonso del Arte, Feb 20 2015
For n >= 2, a(n) = A028347(n+1) + A101986(n-2). - Bui Quang Tuan, Apr 03 2015
For n > 0: a(n) = A258708(n+3,n-1). - Reinhard Zumkeller, Jun 23 2015
a(n) = A175254(n) + A072481(n), n >= 1. - Omar E. Pol, Aug 12 2015
a(n) = A000332(n+3) - A000332(n+1). - Antal Pinter, Dec 27 2015
Dirichlet g.f.: zeta(s-3)/3 + zeta(s-2)/2 + zeta(s-1)/6. - Ilya Gutkovskiy, Jun 26 2016
a(n) = A080851(2,n-1). - R. J. Mathar, Jul 28 2016
a(n) = (A005408(n) * A046092(n))/12 = (2*n+1)*(2*n*(n+1))/12. - Bruce J. Nicholson, May 18 2017
12*a(n) = (n+1)*A001105(n) + n*A001105(n+1). - Bruno Berselli, Jul 03 2017
a(n) = binomial(n-1, 1) + binomial(n-1, 2) + binomial(n, 3) + binomial(n+1, 2) + binomial(n+1, 3). - Tony Foster III, Aug 24 2018
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Nathan Fox, Dec 04 2019
Let T(n) = A000217(n), the n-th triangular number. Then a(n) = (T(n)+1)^2 + (T(n)+2)^2 + ... + (T(n)+n)^2 - (n+2)*T(n)^2. - Charlie Marion, Dec 31 2019
a(n) = 2*n - 1 - a(n-2) + 2*a(n-1). - Boštjan Gec, Nov 09 2023
a(n) = 2/(2*n)! * Sum_{j = 1..n} (-1)^(n+j) * j^(2*n+2) * binomial(2*n, n-j). Cf. A060493. - Peter Bala, Mar 31 2025

Extensions

Partially edited by Joerg Arndt, Mar 11 2010

A013661 Decimal expansion of Pi^2/6 = zeta(2) = Sum_{m>=1} 1/m^2.

Original entry on oeis.org

1, 6, 4, 4, 9, 3, 4, 0, 6, 6, 8, 4, 8, 2, 2, 6, 4, 3, 6, 4, 7, 2, 4, 1, 5, 1, 6, 6, 6, 4, 6, 0, 2, 5, 1, 8, 9, 2, 1, 8, 9, 4, 9, 9, 0, 1, 2, 0, 6, 7, 9, 8, 4, 3, 7, 7, 3, 5, 5, 5, 8, 2, 2, 9, 3, 7, 0, 0, 0, 7, 4, 7, 0, 4, 0, 3, 2, 0, 0, 8, 7, 3, 8, 3, 3, 6, 2, 8, 9, 0, 0, 6, 1, 9, 7, 5, 8, 7, 0
Offset: 1

Views

Author

Keywords

Comments

"In 1736 he [Leonard Euler, 1707-1783] discovered the limit to the infinite series, Sum 1/n^2. He did it by doing some rather ingenious mathematics using trigonometric functions that proved the series summed to exactly Pi^2/6. How can this be? ... This demonstrates one of the most startling characteristics of mathematics - the interconnectedness of, seemingly, unrelated ideas." - Clawson [See Hardy and Wright, Theorems 332 and 333. - N. J. A. Sloane, Jan 20 2017]
Also dilogarithm(1). - Rick L. Shepherd, Jul 21 2004
Also Integral_{x>=0} x/(exp(x)-1) dx. [Abramowitz-Stegun, 23.2.7., for s=2, p. 807]
For the partial sums see the fractional sequence A007406/A007407.
Pi^2/6 is also the length of the circumference of a circle whose diameter equals the ratio of volume of an ellipsoid to the circumscribed cuboid. Pi^2/6 is also the length of the circumference of a circle whose diameter equals the ratio of surface area of a sphere to the circumscribed cube. - Omar E. Pol, Oct 07 2011
1 < n^2/(eulerphi(n)*sigma(n)) < zeta(2) for n > 1. - Arkadiusz Wesolowski, Sep 04 2012
Volume of a sphere inscribed in a cube of volume Pi. More generally, Pi^x/6 is the volume of an ellipsoid inscribed in a cuboid of volume Pi^(x-1). - Omar E. Pol, Feb 17 2016
Surface area of a sphere inscribed in a cube of surface area Pi. More generally, Pi^x/6 is the surface area of a sphere inscribed in a cube of surface area Pi^(x-1). - Omar E. Pol, Feb 19 2016
zeta(2)+1 is a weighted average of the integers, n > 2, using zeta(n)-1 as the weights for each n. We have: Sum_{n >= 2} (zeta(n)-1) = 1 and Sum_{n >= 2} n*(zeta(n)-1) = zeta(2)+1. - Richard R. Forberg, Jul 14 2016
zeta(2) is the expected value of sigma(n)/n. - Charlie Neder, Oct 22 2018
Graham shows that a rational number x can be expressed as a finite sum of reciprocals of distinct squares if and only if x is in [0, Pi^2/6-1) U [1, Pi^2/6). See section 4 for other results and Theorem 5 for the underlying principle. - Charles R Greathouse IV, Aug 04 2020
From Peter Bala, Aug 24 2025: (Start)
By definition, zeta(2) = lim_{n -> oo} s(n), where s(n) = Sum_{k = 1..n} 1/k^2. The convergence is slow. For example, s(50) = 1.6(25...) is only correct to 1 decimal digit.
Let S(n) = Sum_{k = 0..n} (-1)^(n+k)*binomial(n, k)*binomial(n+k, k)*s(n+k). It appears that S(n) converges to zeta(2) much more rapidly. For example, S(50) = 1.64493406684822643647241516664602(137...) gives zeta(2) correct to 32 decimal digits. Cf. A073004. (End)

Examples

			1.6449340668482264364724151666460251892189499012067984377355582293700074704032...
		

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. 811.
  • F. Aubonnet, D. Guinin and B. Joppin, Précis de Mathématiques, Analyse 2, Classes Préparatoires, Premier Cycle Universitaire, Bréal, 1990, Exercice 908, pages 82 and 91-92.
  • Calvin C. Clawson, Mathematical Mysteries, The Beauty and Magic of Numbers, Perseus Books, 1996, p. 97.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 262.
  • W. Dunham, Euler: The Master of Us All, The Mathematical Association of America, Washington, D.C., 1999, p. xxii.
  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Sections 1.4.1 and 5.16, pp. 20, 365.
  • Hardy and Wright, 'An Introduction to the Theory of Numbers'. See Theorems 332 and 333.
  • A. A. Markoff, Mémoire sur la transformation de séries peu convergentes en séries très convergentes, Mém. de l'Acad. Imp. Sci. de St. Pétersbourg, XXXVII, 1890.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 10, 161-162.
  • G. F. Simmons, Calculus Gems, Section B.15, B.24, pp. 270-271, 323-325, McGraw Hill, 1992.
  • Arnold Walfisz, Weylsche Exponentialsummen in der neueren Zahlentheorie, Deutscher Verlag der Wissenschaften, Berlin, 1963, p. 99, Satz 1.
  • A. Weil, Number theory: an approach through history; from Hammurapi to Legendre, Birkhäuser, Boston, 1984; see p. 261.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Revised Edition, Penguin Books, London, England, 1997, page 23.

Crossrefs

Cf. A001008 (H(n): numerators), A002805 (denominators), A013679 (continued fraction), A002117 (zeta(3)), A013631 (cont.frac. for zeta(3)), A013680 (cont.frac. for zeta(4)), 1/A059956, A108625, A142995, A142999.
Cf. A000290.

Programs

  • Magma
    pi:=Pi(RealField(110)); Reverse(Intseq(Floor(10^105*pi^2/6))); // Vincenzo Librandi, Oct 13 2015
    
  • Maple
    evalf(Pi^2/6,120); # Muniru A Asiru, Oct 25 2018
    # Calculates an approximation with n exact decimal places (small deviation
    # in the last digits are possible). Goes back to ideas of A. A. Markoff 1890.
    zeta2 := proc(n) local q, s, w, v, k; q := 0; s := 0; w := 1; v := 4;
    for k from 2 by 2 to 7*n/2 do
        w := w*v/k;
        q := q + v;
        v := v + 8;
        s := s + 1/(w*q);
    od; 12*s; evalf[n](%) end:
    zeta2(1000); # Peter Luschny, Jun 10 2020
  • Mathematica
    RealDigits[N[Pi^2/6, 100]][[1]]
    RealDigits[Zeta[2],10,120][[1]] (* Harvey P. Dale, Jan 08 2021 *)
  • Maxima
    fpprec : 100$ ev(bfloat(zeta(2)))$ bfloat(%); /* Martin Ettl, Oct 21 2012 */
    
  • PARI
    default(realprecision, 200); Pi^2/6
    
  • PARI
    default(realprecision, 200); dilog(1)
    
  • PARI
    default(realprecision, 200); zeta(2)
    
  • PARI
    A013661(n)={localprec(n+2); Pi^2/.6\10^n%10} \\ Corrected and improved by M. F. Hasler, Apr 20 2021
    
  • PARI
    default(realprecision, 20080); x=Pi^2/6; for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b013661.txt", n, " ", d)); \\ Harry J. Smith, Apr 29 2009
    
  • PARI
    sumnumrat(1/x^2, 1) \\ Charles R Greathouse IV, Jan 20 2022
    
  • Python
    # Use some guard digits when computing.
    # BBP formula (3 / 16) P(2, 64, 6, (16, -24, -8, -6,  1, 0)).
    from decimal import Decimal as dec, getcontext
    def BBPzeta2(n: int) -> dec:
        getcontext().prec = n
        s = dec(0); f = dec(1); g = dec(64)
        for k in range(int(n * 0.5536546824812272) + 1):
            sixk = dec(6 * k)
            s += f * ( dec(16) / (sixk + 1) ** 2 - dec(24) / (sixk + 2) ** 2
                     - dec(8)  / (sixk + 3) ** 2 - dec(6)  / (sixk + 4) ** 2
                     + dec(1)  / (sixk + 5) ** 2 )
            f /= g
        return (s * dec(3)) / dec(16)
    print(BBPzeta2(2000))  # Peter Luschny, Nov 01 2023

Formula

Limit_{n->oo} (1/n)*(Sum_{k=1..n} frac((n/k)^(1/2))) = zeta(2) and in general we have lim_{n->oo} (1/n)*(Sum_{k=1..n} frac((n/k)^(1/m))) = zeta(m), m >= 2. - Yalcin Aktar, Jul 14 2005
Equals Integral_{x=0..1} (log(x)/(x-1)) dx or Integral_{x>=1} (log(x/(x-1))/x) dx. - Jean-François Alcover, May 30 2013
For s >= 2 (including Complex), zeta(s) = Product_{n >= 1} prime(n)^s/(prime(n)^s - 1). - Fred Daniel Kline, Apr 10 2014
Also equals 1 + Sum_{n>=0} (-1)^n*StieltjesGamma(n)/n!. - Jean-François Alcover, May 07 2014
zeta(2) = Sum_{n>=1} ((floor(sqrt(n)) - floor(sqrt(n-1)))/n). - Mikael Aaltonen, Jan 10 2015
zeta(2) = Sum_{n>=1} (((sqrt(5)-1)/2/sqrt(5))^n/n^2) + Sum_{n>=1} (((sqrt(5)+1)/2/sqrt(5))^n/ n^2) + log((sqrt(5)-1)/2/sqrt(5))log((sqrt(5)+1)/2/sqrt(5)). - Seiichi Kirikami, Oct 14 2015
The above formula can also be written zeta(2) = dilog(x) + dilog(y) + log(x)*log(y) where x = (1-1/sqrt(5))/2 and y=(1+1/sqrt(5))/2. - Peter Luschny, Oct 16 2015
zeta(2) = Integral_{x>=0} 1/(1 + e^x^(1/2)) dx, because (1 - 1/2^(s-1))*Gamma[1 + s]*Zeta[s] = Integral_{x>=0} 1/(1 + e^x^(1/s)) dx. After Jean-François Alcover in A002162. - Mats Granvik, Sep 12 2016
zeta(2) = Product_{n >= 1} (144*n^4)/(144*n^4 - 40*n^2 + 1). - Fred Daniel Kline, Oct 29 2016
zeta(2) = lim_{n->oo} (1/n) * Sum_{k=1..n} A017665(k)/A017666(k). - Dimitri Papadopoulos, May 10 2019 [See the Walfisz reference, and a comment in A284648, citing also the Sándor et al. Handbook. - Wolfdieter Lang, Aug 22 2019]
Equals Sum_{k>=1} H(k)/(k*(k+1)), where H(k) = A001008(k)/A002805(k) is the k-th harmonic number. - Amiram Eldar, Aug 16 2020
Equals (8/3)*(1/2)!^4 = (8/3)*Gamma(3/2)^4. - Gary W. Adamson, Aug 17 2021
Equals ((m+1)/m) * Integral_{x=0..1} log(Sum {k=0..m} x^k )/x dx, m > 0 (Aubonnet reference). - _Bernard Schott, Feb 11 2022
Equals 1 + Sum_{n>=1} n*(zeta(n+2)-1). - Richard R. Forberg, Jun 04 2023; improved by Natalia L. Skirrow, Jul 25 2025
Equals Psi'(1) where Psi'(x) is the trigamma function (by Abramowitz Stegun 6.4.2). - Andrea Pinos, Oct 22 2024
Equals Integral_{x=0..1} Integral_{y=0..1} 1/(1 - x*y) dy dx. - Kritsada Moomuang, May 22 2025
Equals 1 + Sum_{n>=1} 1/(n^2*(n+1)). - Natalia L. Skirrow, Jul 25 2025

Extensions

Edited by N. J. A. Sloane, Nov 22 2023

A000124 Central polygonal numbers (the Lazy Caterer's sequence): n(n+1)/2 + 1; or, maximal number of pieces formed when slicing a pancake with n cuts.

Original entry on oeis.org

1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79, 92, 106, 121, 137, 154, 172, 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466, 497, 529, 562, 596, 631, 667, 704, 742, 781, 821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226, 1276, 1327, 1379
Offset: 0

Views

Author

Keywords

Comments

These are Hogben's central polygonal numbers with the (two-dimensional) symbol
2
.P
1 n
The first line cuts the pancake into 2 pieces. For n > 1, the n-th line crosses every earlier line (avoids parallelism) and also avoids every previous line intersection, thus increasing the number of pieces by n. For 16 lines, for example, the number of pieces is 2 + 2 + 3 + 4 + 5 + ... + 16 = 137. These are the triangular numbers plus 1 (cf. A000217).
m = (n-1)(n-2)/2 + 1 is also the smallest number of edges such that all graphs with n nodes and m edges are connected. - Keith Briggs, May 14 2004
Also maximal number of grandchildren of a binary vector of length n+2. E.g., a binary vector of length 6 can produce at most 11 different vectors when 2 bits are deleted.
This is also the order dimension of the (strong) Bruhat order on the finite Coxeter group B_{n+1}. - Nathan Reading (reading(AT)math.umn.edu), Mar 07 2002
Number of 132- and 321-avoiding permutations of {1,2,...,n+1}. - Emeric Deutsch, Mar 14 2002
For n >= 1 a(n) is the number of terms in the expansion of (x+y)*(x^2+y^2)*(x^3+y^3)*...*(x^n+y^n). - Yuval Dekel (dekelyuval(AT)hotmail.com), Jul 28 2003
Also the number of terms in (1)(x+1)(x^2+x+1)...(x^n+...+x+1); see A000140.
Narayana transform (analog of the binomial transform) of vector [1, 1, 0, 0, 0, ...] = A000124; using the infinite lower Narayana triangle of A001263 (as a matrix), N; then N * [1, 1, 0, 0, 0, ...] = A000124. - Gary W. Adamson, Apr 28 2005
Number of interval subsets of {1, 2, 3, ..., n} (cf. A002662). - Jose Luis Arregui (arregui(AT)unizar.es), Jun 27 2006
Define a number of straight lines in the plane to be in general arrangement when (1) no two lines are parallel, (2) there is no point common to three lines. Then these are the maximal numbers of regions defined by n straight lines in general arrangement in the plane. - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
Note that a(n) = a(n-1) + A000027(n-1). This has the following geometrical interpretation: Suppose there are already n-1 lines in general arrangement, thus defining the maximal number of regions in the plane obtainable by n-1 lines and now one more line is added in general arrangement. Then it will cut each of the n-1 lines and acquire intersection points which are in general arrangement. (See the comments on A000027 for general arrangement with points.) These points on the new line define the maximal number of regions in 1-space definable by n-1 points, hence this is A000027(n-1), where for A000027 an offset of 0 is assumed, that is, A000027(n-1) = (n+1)-1 = n. Each of these regions acts as a dividing wall, thereby creating as many new regions in addition to the a(n-1) regions already there, hence a(n) = a(n-1) + A000027(n-1). Cf. the comments on A000125 for an analogous interpretation. - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
When constructing a zonohedron, one zone at a time, out of (up to) 3-d non-intersecting parallelepipeds, the n-th element of this sequence is the number of edges in the n-th zone added with the n-th "layer" of parallelepipeds. (Verified up to 10-zone zonohedron, the enneacontahedron.) E.g., adding the 10th zone to the enneacontahedron requires 46 parallel edges (edges in the 10th zone) by looking directly at a 5-valence vertex and counting visible vertices. - Shel Kaphan, Feb 16 2006
Binomial transform of (1, 1, 1, 0, 0, 0, ...) and inverse binomial transform of A072863: (1, 3, 9, 26, 72, 192, ...). - Gary W. Adamson, Oct 15 2007
If Y is a 2-subset of an n-set X then, for n >= 3, a(n-3) is the number of (n-2)-subsets of X which do not have exactly one element in common with Y. - Milan Janjic, Dec 28 2007
Equals row sums of triangle A144328. - Gary W. Adamson, Sep 18 2008
It appears that a(n) is the number of distinct values among the fractions F(i+1)/F(j+1) as j ranges from 1 to n and, for each fixed j, i ranges from 1 to j, where F(i) denotes the i-th Fibonacci number. - John W. Layman, Dec 02 2008
a(n) is the number of subsets of {1,2,...,n} that contain at most two elements. - Geoffrey Critzer, Mar 10 2009
For n >= 2, a(n) gives the number of sets of subsets A_1, A_2, ..., A_n of n = {1, 2, ..., n} such that Meet_{i = 1..n} A_i is empty and Sum_{j in [n]} (|Meet{i = 1..n, i != j} A_i|) is a maximum. - Srikanth K S, Oct 22 2009
The numbers along the left edge of Floyd's triangle. - Paul Muljadi, Jan 25 2010
Let A be the Hessenberg matrix of order n, defined by: A[1,j] = A[i,i]:=1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n-1) = (-1)^(n-1)*coeff(charpoly(A,x),x). - Milan Janjic, Jan 24 2010
Also the number of deck entries of Euler's ship. See the Meijer-Nepveu link. - Johannes W. Meijer, Jun 21 2010
(1 + x^2 + x^3 + x^4 + x^5 + ...)*(1 + 2x + 3x^2 + 4x^3 + 5x^4 + ...) = (1 + 2x + 4x^2 + 7x^3 + 11x^4 + ...). - Gary W. Adamson, Jul 27 2010
The number of length n binary words that have no 0-digits between any pair of consecutive 1-digits. - Jeffrey Liese, Dec 23 2010
Let b(0) = b(1) = 1; b(n) = max(b(n-1)+n-1, b(n-2)+n-2) then a(n) = b(n+1). - Yalcin Aktar, Jul 28 2011
Also number of triangular numbers so far, for n > 0: a(n) = a(n-1) + Sum(A010054(a(k)): 0 <= k < n), see also A097602, A131073. - Reinhard Zumkeller, Nov 15 2012
Also number of distinct sums of 1 through n where each of those can be + or -. E.g., {1+2,1-2,-1+2,-1-2} = {3,-1,1,-3} and a(2) = 4. - Toby Gottfried, Nov 17 2011
This sequence is complete because the sum of the first n terms is always greater than or equal to a(n+1)-1. Consequently, any nonnegative number can be written as a sum of distinct terms of this sequence. See A204009, A072638. - Frank M Jackson, Jan 09 2012
The sequence is the number of distinct sums of subsets of the nonnegative integers, and its first differences are the positive integers. See A208531 for similar results for the squares. - John W. Layman, Feb 28 2012
Apparently the number of Dyck paths of semilength n+1 in which the sum of the first and second ascents add to n+1. - David Scambler, Apr 22 2013
Without 1 and 2, a(n) equals the terminus of the n-th partial sum of sequence 1, 1, 2. Explanation: 1st partial sums of 1, 1, 2 are 1, 2, 4; 2nd partial sums are 1, 3, 7; 3rd partial sums are 1, 4, 11; 4th partial sums are 1, 5, 16, etc. - Bob Selcoe, Jul 04 2013
Equivalently, numbers of the form 2*m^2+m+1, where m = 0, -1, 1, -2, 2, -3, 3, ... . - Bruno Berselli, Apr 08 2014
For n >= 2: quasi-triangular numbers; the almost-triangular numbers being A000096(n), n >= 2. Note that 2 is simultaneously almost-triangular and quasi-triangular. - Daniel Forgues, Apr 21 2015
n points in general position determine "n choose 2" lines, so A055503(n) <= a(n(n-1)/2). If n > 3, the lines are not in general position and so A055503(n) < a(n(n-1)/2). - Jonathan Sondow, Dec 01 2015
The digital root is period 9 (1, 2, 4, 7, 2, 7, 4, 2, 1), also the digital roots of centered 10-gonal numbers (A062786), for n > 0, A133292. - Peter M. Chema, Sep 15 2016
Partial sums of A028310. - J. Conrad, Oct 31 2016
For n >= 0, a(n) is the number of weakly unimodal sequences of length n over the alphabet {1, 2}. - Armend Shabani, Mar 10 2017
From Eric M. Schmidt, Jul 17 2017: (Start)
Number of sequences (e(1), ..., e(n+1)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) < e(j) != e(k). [Martinez and Savage, 2.4]
Number of sequences (e(1), ..., e(n+1)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) < e(j) and e(i) < e(k). [Martinez and Savage, 2.4]
Number of sequences (e(1), ..., e(n+1)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) >= e(j) != e(k). [Martinez and Savage, 2.4]
(End)
Numbers m such that 8m - 7 is a square. - Bruce J. Nicholson, Jul 24 2017
From Klaus Purath, Jan 29 2020: (Start)
The odd prime factors != 7 occur in an interval of p successive terms either never or exactly twice, while 7 always occurs only once. If a prime factor p appears in a(n) and a(m) within such an interval, then n + m == -1 (mod p). When 7 divides a(n), then 2*n == -1 (mod 7). a(n) is never divisible by the prime numbers given in A003625.
While all prime factors p != 7 can occur to any power, a(n) is never divisible by 7^2. The prime factors are given in A045373. The prime terms of this sequence are given in A055469.
(End)
From Roger Ford, May 10 2021: (Start)
a(n-1) is the greatest sum of arch lengths for the top arches of a semi-meander with n arches. An arch length is the number of arches covered + 1.
/\ The top arch has a length of 3. /\ The top arch has a length of 3.
/ \ Both bottom arches have a //\\ The middle arch has a length of 2.
//\/\\ length of 1. ///\\\ The bottom arch has a length of 1.
Example: for n = 4, a(4-1) = a(3) = 7 /\
//\\
/\ ///\\\ 1 + 3 + 2 + 1 = 7. (End)
a(n+1) is the a(n)-th smallest positive integer that has not yet appeared in the sequence. - Matthew Malone, Aug 26 2021
For n> 0, let the n-dimensional cube {0,1}^n be, provided with the Hamming distance, d. Given an element x in {0,1}^n, a(n) is the number of elements y in {0,1}^n such that d(x, y) <= 2. Example: n = 4. (0,0,0,0), (1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1), (0,0,1,1), (0,1,0,1), (0,1,1,0), (1,0,0,1), (1,0,1,0), (1,1,0,0) are at distance <= 2 from (0,0,0,0), so a(4) = 11. - Yosu Yurramendi, Dec 10 2021
a(n) is the sum of the first three entries of row n of Pascal's triangle. - Daniel T. Martin, Apr 13 2022
a(n-1) is the number of Grassmannian permutations that avoid a pattern, sigma, where sigma is a pattern of size 3 with exactly one descent. For example, sigma is one of the patterns, {132, 213, 231, 312}. - Jessica A. Tomasko, Sep 14 2022
a(n+4) is the number of ways to tile an equilateral triangle of side length 2*n with smaller equilateral triangles of side length n and side length 1. For example, with n=2, there are 22 ways to tile an equilateral triangle of side length 4 with smaller ones of sides 2 and 1, including the one tiling with sixteen triangles of sides 1 and the one tiling with four triangles of sides 2. - Ahmed ElKhatib and Greg Dresden, Aug 19 2024
Define a "hatpin" to be the planar graph consisting of a distinguished point (called the "head") and a semi-infinite line from that point. The maximum number of regions than can be formed by drawing n hatpins is a(n-1). See link for the case n = 4. - N. J. A. Sloane, Jun 25 2025

Examples

			a(3) = 7 because the 132- and 321-avoiding permutations of {1, 2, 3, 4} are 1234, 2134, 3124, 2314, 4123, 3412, 2341.
G.f. = 1 + 2*x + 4*x^2 + 7*x^3 + 11*x^4 + 16*x^5 + 22*x^6 + 29*x^7 + ...
		

References

  • Robert B. Banks, Slicing Pizzas, Racing Turtles and Further Adventures in Applied Mathematics, Princeton Univ. Press, 1999. See p. 24.
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 80.
  • Henry Ernest Dudeney, Amusements in Mathematics, Nelson, London, 1917, page 177.
  • Derrick Niederman, Number Freak, From 1 to 200 The Hidden Language of Numbers Revealed, A Perigee Book, NY, 2009, p. 83.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • Alain M. Robert, A Course in p-adic Analysis, Springer-Verlag, 2000; p. 213.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane, On single-deletion-correcting codes, in Codes and Designs (Columbus, OH, 2000), 273-291, Ohio State Univ. Math. Res. Inst. Publ., 10, de Gruyter, Berlin, 2002.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 98.
  • William Allen Whitworth, DCC Exercises in Choice and Chance, Stechert, NY, 1945, p. 30.
  • Akiva M. Yaglom and Isaak M. Yaglom, Challenging Mathematical Problems with Elementary Solutions. Vol. I. Combinatorial Analysis and Probability Theory. New York: Dover Publications, Inc., 1987, p. 13, #44 (First published: San Francisco: Holden-Day, Inc., 1964).

Crossrefs

Cf. A000096 (Maximal number of pieces that can be obtained by cutting an annulus with n cuts, for n >= 1).
Slicing a cake: A000125, a bagel: A003600.
Partial sums =(A033547)/2, (A014206)/2.
The first 20 terms are also found in A025732 and A025739.
Cf. also A055469 Quasi-triangular primes, A002620, A000217.
A row of the array in A386478.

Programs

Formula

G.f.: (1 - x + x^2)/(1 - x)^3. - Simon Plouffe in his 1992 dissertation
a(n) = A108561(n+3, 2). - Reinhard Zumkeller, Jun 10 2005
G.f.: (1 - x^6)/((1 - x)^2*(1 - x^2)*(1 - x^3)). a(n) = a(-1 - n) for all n in Z. - Michael Somos, Sep 04 2006
Euler transform of length 6 sequence [ 2, 1, 1, 0, 0, -1]. - Michael Somos, Sep 04 2006
a(n+3) = 3*a(n+2) - 3*a(n+1) + a(n) and a(1) = 1, a(2) = 2, a(3) = 4. - Artur Jasinski, Oct 21 2008
a(n) = A000217(n) + 1.
a(n) = a(n-1) + n. E.g.f.:(1 + x + x^2/2)*exp(x). - Geoffrey Critzer, Mar 10 2009
a(n) = Sum_{k = 0..n + 1} binomial(n+1, 2(k - n)). - Paul Barry, Aug 29 2004
a(n) = binomial(n+2, 1) - 2*binomial(n+1, 1) + binomial(n+2, 2). - Zerinvary Lajos, May 12 2006
From Thomas Wieder, Feb 25 2009: (Start)
a(n) = Sum_{l_1 = 0..n + 1} Sum_{l_2 = 0..n}...Sum_{l_i = 0..n - i}...Sum_{l_n = 0..1} delta(l_1, l_2, ..., l_i, ..., l_n) where delta(l_1, l_2, ..., l_i, ..., l_n) = 0 if any l_i != l_(i+1) and l_(i+1) != 0 and delta(l_1, l_2, ..., l_i, ..., l_n) = 1 otherwise. (End)
a(n) = A034856(n+1) - A005843(n) = A000217(n) + A005408(n) - A005843(n). - Jaroslav Krizek, Sep 05 2009
a(n) = 2*a(n-1) - a(n-2) + 1. - Eric Werley, Jun 27 2011
E.g.f.: exp(x)*(1+x+(x^2)/2) = Q(0); Q(k) = 1+x/(1-x/(2+x-4/(2+x*(k+1)/Q(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
a(n) = A014132(n, 1) for n > 0. - Reinhard Zumkeller, Dec 12 2012
a(n) = 1 + floor(n/2) + ceiling(n^2/2) = 1 + A004526(n) + A000982(n). - Wesley Ivan Hurt, Jun 14 2013
a(n) = A228074(n+1, n). - Reinhard Zumkeller, Aug 15 2013
For n > 0: A228446(a(n)) = 3. - Reinhard Zumkeller, Mar 12 2014
a(n) >= A263883(n) and a(n(n-1)/2) >= A055503(n). - Jonathan Sondow, Dec 01 2015
From Ilya Gutkovskiy, Jun 29 2016: (Start)
Dirichlet g.f.: (zeta(s-2) + zeta(s-1) + 2*zeta(s))/2.
Sum_{n >= 0} 1/a(n) = 2*Pi*tanh(sqrt(7)*Pi/2)/sqrt(7) = A226985. (End)
a(n) = (n+1)^2 - A000096(n). - Anton Zakharov, Jun 29 2016
a(n) = A101321(1, n). - R. J. Mathar, Jul 28 2016
a(n) = 2*a(n-1) - binomial(n-1, 2) and a(0) = 1. - Armend Shabani, Mar 10 2017
a(n) = A002620(n+2) + A002620(n-1). - Anton Zakharov, May 11 2017
From Klaus Purath, Jan 29 2020: (Start)
a(n) = (Sum_{i=n-2..n+2} A000217(i))/5.
a(n) = (Sum_{i=n-2..n+2} A002378(i))/10.
a(n) = (Sum_{i=n..n+2} A002061(i)+1)/6.
a(n) = (Sum_{i=n-1..n+2} A000290(i)+2)/8.
a(n) = A060533(n-1) + 10, n > 5.
a(n) = (A002378(n) + 2)/2.
a(n) = A152948(n+2) - 1.
a(n) = A152950(n+1) - 2.
a(n) = (A002061(n) + A002061(n+2))/4.
(End)
Sum_{n>=0} (-1)^n/a(n) = A228918. - Amiram Eldar, Nov 20 2020
From Amiram Eldar, Feb 17 2021: (Start)
Product_{n>=0} (1 + 1/a(n)) = cosh(sqrt(15)*Pi/2)*sech(sqrt(7)*Pi/2).
Product_{n>=1} (1 - 1/a(n)) = 2*Pi*sech(sqrt(7)*Pi/2). (End)
a((n^2-3n+6)/2) + a((n^2-n+4)/2) = a(n^2-2n+6)/2. - Charlie Marion, Feb 14 2023

A005384 Sophie Germain primes p: 2p+1 is also prime.

Original entry on oeis.org

2, 3, 5, 11, 23, 29, 41, 53, 83, 89, 113, 131, 173, 179, 191, 233, 239, 251, 281, 293, 359, 419, 431, 443, 491, 509, 593, 641, 653, 659, 683, 719, 743, 761, 809, 911, 953, 1013, 1019, 1031, 1049, 1103, 1223, 1229, 1289, 1409, 1439, 1451, 1481, 1499, 1511, 1559
Offset: 1

Views

Author

Keywords

Comments

Then 2p+1 is called a safe prime: see A005385.
Primes p such that the equation phi(x) = 2p has solutions, where phi is the totient function. See A087634 for another such collection of primes. - T. D. Noe, Oct 24 2003
Subsequence of A117360. - Reinhard Zumkeller, Mar 10 2006
Let q = 2n+1. For these n (and q), the difference of two cyclotomic polynomials can be written as a cyclotomic polynomial in x^2: Phi(q,x) - Phi(2q,x) = 2x Phi(n,x^2). - T. D. Noe, Jan 04 2008
A Sophie Germain prime p is 2, 3 or of the form 6k-1, k >= 1, i.e., p = 5 (mod 6). A prime p of the form 6k+1, k >= 1, i.e., p = 1 (mod 6), cannot be a Sophie Germain prime since 2p+1 is divisible by 3. - Daniel Forgues, Jul 31 2009
Also solutions to the equation: floor(4/A000005(2*n^2+n)) = 1. - Enrique Pérez Herrero, May 03 2012
In the spirit of the conjecture related to A217788, we conjecture that for any integers n >= m > 0 there are infinitely many integers b > a(n) such that the number Sum_{k=m..n} a(k)*b^(n-k) is prime. - Zhi-Wei Sun, Mar 26 2013
If k is the product of a Sophie Germain prime p and its corresponding safe prime 2p+1, then a(n) = (k-phi(k))/3, where phi is Euler's totient function. - Wesley Ivan Hurt, Oct 03 2013
Giovanni Resta found the first Sophie Germain prime which is also a Brazilian number (A125134), 28792661 = 1 + 73 + 73^2 + 73^3 + 73^4 = (11111)73. - _Bernard Schott, Mar 07 2019
For all Sophie Germain primes p >= 5, 2*p + 1 = min(A, B) where A is the smallest prime factor of 2^p - 1 and B the smallest prime factor of (2^p + 1) / 3. - Alain Rocchelli, Feb 01 2023
Consider a pair of numbers (p, 2*p+1), with p >= 3. Then p is a Sophie Germain prime iff (p-1)!^2 + 6*p == 1 (mod p*(2*p+1)). - Davide Rotondo, May 02 2024

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. 870.
  • A. Peretti, The quantity of Sophie Germain primes less than x, Bull. Number Theory Related Topics, Vol. 11, No. 1-3 (1987), pp. 81-92.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 76, 227-230.
  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 83.
  • 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 114.

Crossrefs

Cf. also A000355, A156541, A156542, A156592, A161896, A156660, A156874, A092816, A023212, A007528 (primes of the form 6k-1).
For primes p that remains prime through k iterations of the function f(x) = 2x + 1: this sequence (k=1), A007700 (k=2), A023272 (k=3), A023302 (k=4), A023330 (k=5), A278932 (k=6), A138025 (k=7), A138030 (k=8).

Programs

  • GAP
    Filtered([1..1600],p->IsPrime(p) and IsPrime(2*p+1)); # Muniru A Asiru, Mar 06 2019
    
  • Magma
    [ p: p in PrimesUpTo(1560) | IsPrime(2*p+1) ]; // Klaus Brockhaus, Jan 01 2009
    
  • Maple
    A:={}: for n from 1 to 246 do if isprime(2*ithprime(n)+1) then A:=A union {ithprime(n)} fi od: A:=A; # Emeric Deutsch, Dec 09 2004
  • Mathematica
    Select[Prime[Range[1000]],PrimeQ[2#+1]&]
    lst = {}; Do[If[PrimeQ[n + 1] && PrimeOmega[n] == 2, AppendTo[lst, n/2]], {n, 2, 10^4}]; lst (* Hilko Koning, Aug 17 2021 *)
  • PARI
    select(p->isprime(2*p+1), primes(1000)) \\ In old PARI versions <= 2.4.2, use select(primes(1000), p->isprime(2*p+1)).
    
  • PARI
    forprime(n=2, 10^3, if(ispseudoprime(2*n+1), print1(n, ", "))) \\ Felix Fröhlich, Jun 15 2014
    
  • PARI
    is_A005384=(p->isprime(2*p+1)&&isprime(p));
      {A005384_vec(N=100,p=1)=vector(N,i,until(isprime(2*p+1),p=nextprime(p+1));p)} \\ M. F. Hasler, Mar 03 2020
    
  • Python
    from sympy import isprime, nextprime
    def ok(p): return isprime(2*p+1)
    def aupto(limit): # only test primes
      alst, p = [], 2
      while p <= limit:
        if ok(p): alst.append(p)
        p = nextprime(p)
      return alst
    print(aupto(1559)) # Michael S. Branicky, Feb 03 2021

Formula

a(n) mod 10 <> 7. - Reinhard Zumkeller, Feb 12 2009
A156660(a(n)) = 1; A156874 gives numbers of Sophie Germain primes <= n. - Reinhard Zumkeller, Feb 18 2009
tau(4*a(n) + 2) = tau(4*a(n)) - 2, for n > 1. - Arkadiusz Wesolowski, Aug 25 2012
eulerphi(4*a(n) + 2) = eulerphi(4*a(n)) + 2, for n > 1. - Arkadiusz Wesolowski, Aug 26 2012
A005097 INTERSECT A000040. - R. J. Mathar, Mar 23 2017
Sum_{n>=1} 1/a(n) is in the interval (1.533944198, 1.8026367) (Wagstaff, 2021). - Amiram Eldar, Nov 04 2021
a(n) >> n log^2 n. - Charles R Greathouse IV, Jul 25 2024

A001787 a(n) = n*2^(n-1).

Original entry on oeis.org

0, 1, 4, 12, 32, 80, 192, 448, 1024, 2304, 5120, 11264, 24576, 53248, 114688, 245760, 524288, 1114112, 2359296, 4980736, 10485760, 22020096, 46137344, 96468992, 201326592, 419430400, 872415232, 1811939328, 3758096384, 7784628224, 16106127360, 33285996544
Offset: 0

Views

Author

Keywords

Comments

Number of edges in an n-dimensional hypercube.
Number of 132-avoiding permutations of [n+2] containing exactly one 123 pattern. - Emeric Deutsch, Jul 13 2001
Number of ways to place n-1 nonattacking kings on a 2 X 2(n-1) chessboard for n >= 2. - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), May 22 2001
Arithmetic derivative of 2^n: a(n) = A003415(A000079(n)). - Reinhard Zumkeller, Feb 26 2002
(-1) times the determinant of matrix A_{i,j} = -|i-j|, 0 <= i,j <= n.
a(n) is the number of ones in binary numbers 1 to 111...1 (n bits). a(n) = A000337(n) - A000337(n-1) for n = 2,3,... . - Emeric Deutsch, May 24 2003
The number of 2 X n 0-1 matrices containing n+1 1's and having no zero row or column. The number of spanning trees of the complete bipartite graph K(2,n). This is the case m = 2 of K(m,n). See A072590. - W. Edwin Clark, May 27 2003
Binomial transform of 0,1,2,3,4,5,... (A001477). Without the initial 0, binomial transform of odd numbers.
With an additional leading zero, [0,0,1,4,...] this is the binomial transform of the integers repeated A004526. Its formula is then (2^n*(n-1) + 0^n)/4. - Paul Barry, May 20 2003
Number of zeros in all different (n+1)-bit integers. - Ralf Stephan, Aug 02 2003
From Lekraj Beedassy, Jun 03 2004: (Start)
Final element of a summation table (as opposed to a difference table) whose first row consists of integers 0 through n (or first n+1 nonnegative integers A001477); illustrating the case n=5:
0 1 2 3 4 5
1 3 5 7 9
4 8 12 16
12 20 28
32 48
80
and the final element is a(5)=80. (End)
This sequence and A001871 arise in counting ordered trees of height at most k where only the rightmost branch at the root actually achieves this height and the count is by the number of edges, with k = 3 for this sequence and k = 4 for A001871.
Let R be a binary relation on the power set P(A) of a set A having n = |A| elements such that for all elements x,y of P(A), xRy if x is a proper subset of y and there are no z in P(A) such that x is a proper subset of z and z is a proper subset of y. Then a(n) = |R|. - Ross La Haye, Sep 21 2004
Number of 2 X n binary matrices avoiding simultaneously the right-angled numbered polyomino patterns (ranpp) (00;1) and (10;1). An occurrence of a ranpp (xy;z) in a matrix A=(a(i,j)) is a triple (a(i1,j1), a(i1,j2), a(i2,j1)) where i1 < i2, j1 < j2 and these elements are in same relative order as those in the triple (x,y,z). - Sergey Kitaev, Nov 11 2004
Number of subsequences 00 in all binary words of length n+1. Example: a(2)=4 because in 000,001,010,011,100,101,110,111 the sequence 00 occurs 4 times. - Emeric Deutsch, Apr 04 2005
If you expand the n-factor expression (a+1)*(b+1)*(c+1)*...*(z+1), there are a(n) variables in the result. For example, the 3-factor expression (a+1)*(b+1)*(c+1) expands to abc+ab+ac+bc+a+b+c+1 with a(3) = 12 variables. - David W. Wilson, May 08 2005
An inverse Chebyshev transform of n^2, where g(x)->(1/sqrt(1-4*x^2))*g(x*c(x^2)), c(x) the g.f. of A000108. - Paul Barry, May 13 2005
Sequences A018215 and A058962 interleaved. - Graeme McRae, Jul 12 2006
The number of never-decreasing positive integer sequences of length n with a maximum value of 2*n. - Ben Paul Thurston, Nov 13 2006
Total size of all the subsets of an n-element set. For example, a 2-element set has 1 subset of size 0, 2 subsets of size 1 and 1 of size 2. - Ross La Haye, Dec 30 2006
Convolution of the natural numbers [A000027] and A045623 beginning [0,1,2,5,...]. - Ross La Haye, Feb 03 2007
If M is the matrix (given by rows) [2,1;0,2] then the sequence gives the (1,2) entry in M^n. - Antonio M. Oller-Marcén, May 21 2007
If X_1,X_2,...,X_n is a partition of a 2n-set X into 2-blocks then, for n > 0, a(n) is equal to the number of (n+1)-subsets of X intersecting each X_i (i=1,2,...,n). - Milan Janjic, Jul 21 2007
Number of n-permutations of 3 objects u,v,w, with repetition allowed, containing exactly one u. Example: a(2)=4 because we have uv, vu, uw and wu. - Zerinvary Lajos, Dec 27 2007
A member of the family of sequences defined by a(n) = n*[c(1)*...*c(r)]^(n-1); c(i) integer. This sequence has c(1)=2, A027471 has c(1)=3. - Ctibor O. Zizka, Feb 23 2008
a(n) is the number of ways to split {1,2,...,n-1} into two (possibly empty) complementary intervals {1,2,...,i} and {i+1,i+2,...,n-1} and then select a subset from each interval. - Geoffrey Critzer, Jan 31 2009
Equals the Jacobsthal sequence A001045 convolved with A003945: (1, 3, 6, 12, ...). - Gary W. Adamson, May 23 2009
Starting with offset 1 = A059570: (1, 2, 6, 14, 34, ...) convolved with (1, 2, 2, 2, ...). - Gary W. Adamson, May 23 2009
Equals the first left hand column of A167591. - Johannes W. Meijer, Nov 12 2009
The number of tatami tilings of an n X n square with n monomers is n*2^(n-1). - Frank Ruskey, Sep 25 2010
Under T. D. Noe's variant of the hypersigma function, this sequence gives hypersigma(2^n): a(n) = A191161(A000079(n)). - Alonso del Arte, Nov 04 2011
Number of Dyck (n+2)-paths with exactly one valley at height 1 and no higher valley. - David Scambler, Nov 07 2011
Equals triangle A059260 * A016777 as a vector, where A016777 = (3n + 1): [1, 4, 7, 10, 13, ...]. - Gary W. Adamson, Mar 06 2012
Main transitions in systems of n particles with spin 1/2 (see A212697 with b=2). - Stanislav Sykora, May 25 2012
Let T(n,k) be the triangle with (first column) T(n,1) = 2*n-1 for n >= 1, otherwise T(n,k) = T(n,k-1) + T(n-1,k-1), then a(n) = T(n,n). - J. M. Bergot, Jan 17 2013
Sum of all parts of all compositions (ordered partitions) of n. The equivalent sequence for partitions is A066186. - Omar E. Pol, Aug 28 2013
Starting with a(1)=1: powers of 2 (A000079) self-convolved. - Bob Selcoe, Aug 05 2015
Coefficients of the series expansion of the normalized Schwarzian derivative -S{p(x)}/6 of the polynomial p(x) = -(x-x1)*(x-x2) with x1 + x2 = 1 (cf. A263646). - Tom Copeland, Nov 02 2015
a(n) is the number of North-East lattice paths from (0,0) to (n+1,n+1) that have exactly one east step below y = x-1 and no east steps above y = x+1. Details can be found in Pan and Remmel's link. - Ran Pan, Feb 03 2016
Also the number of maximal and maximum cliques in the n-hypercube graph for n > 0. - Eric W. Weisstein, Dec 01 2017
Let [n]={1,2,...,n}; then a(n-1) is the total number of elements missing in proper subsets of [n] that contain n to form [n]. For example, for n = 3, a(2) = 4 since the proper subsets of [3] that contain 3 are {3}, {1,3}, {2,3} and the total number of elements missing in these subsets to form [3] is 4: 2 in the first subset, 1 in the second, and 1 in the third. - Enrique Navarrete, Aug 08 2020
Number of 3-permutations of n elements avoiding the patterns 132, 231. See Bonichon and Sun. - Michel Marcus, Aug 19 2022

Examples

			a(2)=4 since 2314, 2341,3124 and 4123 are the only 132-avoiding permutations of 1234 containing exactly one increasing subsequence of length 3.
x + 4*x^2 + 12*x^3 + 32*x^4 + 80*x^5 + 192*x^6 + 448*x^7 + ...
a(5) = 1*0 + 5*1 + 10*2 + 10*3 + 5*4 + 1*5 = 80, with 1,5,10,10,5,1 the 5th row of Pascal's triangle. - _J. M. Bergot_, Apr 29 2014
		

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. 796.
  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 131.
  • Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009, page 282.
  • 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

Three other versions, essentially identical, are A085750, A097067, A118442.
Partial sums of A001792.
A058922(n+1) = 4*A001787(n).
Equals A090802(n, 1).
Column k=1 of A038207.
Row sums of A003506, A322427, A322428.

Programs

  • Haskell
    a001787 n = n * 2 ^ (n - 1)
    a001787_list = zipWith (*) [0..] $ 0 : a000079_list
    -- Reinhard Zumkeller, Jul 11 2014
    
  • Magma
    [n*2^(n-1): n in [0..40]]; // Vincenzo Librandi, Feb 04 2016
    
  • Maple
    spec := [S, {B=Set(Z, 0 <= card), S=Prod(Z, B, B)}, labeled]: seq(combstruct[count](spec, size=n), n=0..29); # Zerinvary Lajos, Oct 09 2006
    A001787:=1/(2*z-1)^2; # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[Sum[Binomial[n, i] i, {i, 0, n}], {n, 0, 30}] (* Geoffrey Critzer, Mar 18 2009 *)
    f[n_] := n 2^(n - 1); f[Range[0, 40]] (* Vladimir Joseph Stephan Orlovsky, Feb 09 2011 *)
    Array[# 2^(# - 1) &, 40, 0] (* Harvey P. Dale, Jul 26 2011 *)
    Join[{0}, Table[n 2^(n - 1), {n, 20}]] (* Eric W. Weisstein, Dec 01 2017 *)
    Join[{0}, LinearRecurrence[{4, -4}, {1, 4}, 20]] (* Eric W. Weisstein, Dec 01 2017 *)
    CoefficientList[Series[x/(-1 + 2 x)^2, {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
  • PARI
    {a(n) = if( n<0, 0, n * 2^(n-1))}
    
  • PARI
    concat(0, Vec(x/(1-2*x)^2 + O(x^50))) \\ Altug Alkan, Nov 03 2015
    
  • Python
    def A001787(n): return n*(1<Chai Wah Wu, Nov 14 2022

Formula

a(n) = Sum_{k=1..n} k*binomial(n, k). - Benoit Cloitre, Dec 06 2002
E.g.f.: x*exp(2x). - Paul Barry, Apr 10 2003
G.f.: x/(1-2*x)^2.
G.f.: x / (1 - 4*x / (1 + x / (1 - x))). - Michael Somos, Apr 07 2012
A108666(n) = Sum_{k=0..n} binomial(n, k)^2 * a(n). - Michael Somos, Apr 07 2012
PSumSIGN transform of A053220. PSumSIGN transform is A045883. Binomial transform is A027471(n+1). - Michael Somos, Jul 10 2003
Starting at a(1)=1, INVERT transform is A002450, INVERT transform of A049072, MOBIUS transform of A083413, PSUM transform is A000337, BINOMIAL transform is A081038, BINOMIAL transform of A005408. - Michael Somos, Apr 07 2012
a(n) = 2*a(n-1)+2^(n-1).
a(2*n) = n*4^n, a(2*n+1) = (2*n+1)4^n.
G.f.: x/det(I-x*M) where M=[1,i;i,1], i=sqrt(-1). - Paul Barry, Apr 27 2005
Starting 1, 1, 4, 12, ... this is 0^n + n2^(n-1), the binomial transform of the 'pair-reversed' natural numbers A004442. - Paul Barry, Jul 24 2003
Convolution of [1, 2, 4, 8, ...] with itself. - Jon Perry, Aug 07 2003
The signed version of this sequence, n(-2)^(n-1), is the inverse binomial transform of n(-1)^(n-1) (alternating sign natural numbers). - Paul Barry, Aug 20 2003
a(n-1) = (Sum_{k=0..n} 2^(n-k-1)*C(n-k, k)*C(1,(k+1)/2)*(1-(-1)^k)/2) - 0^n/4. - Paul Barry, Oct 15 2004
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)(n-2k)^2. - Paul Barry, May 13 2005
a(n+2) = A049611(n+2) - A001788(n).
a(n) = n! * Sum_{k=0..n} 1/((k - 1)!(n - k)!). - Paul Barry, Mar 26 2003
a(n+1) = Sum_{k=0..n} 4^k * A109466(n,k). - Philippe Deléham, Nov 13 2006
Row sums of A130300 starting (1, 4, 12, 32, ...). - Gary W. Adamson, May 20 2007
Equals row sums of triangle A134083. Equals A002064(n) + (2^n - 1). - Gary W. Adamson, Oct 07 2007
a(n) = 4*a(n-1) - 4*a(n-2), a(0)=0, a(1)=1. - Philippe Deléham, Nov 16 2008
Sum_{n>0} 1/a(n) = 2*log(2). - Jaume Oliver Lafont, Feb 10 2009
a(n) = A000788(A000225(n)) = A173921(A000225(n)). - Reinhard Zumkeller, Mar 04 2010
a(n) = n * A011782(n). - Omar E. Pol, Aug 28 2013
a(n-1) = Sum_{t_1+2*t_2+...+n*t_n=n} (t_1+t_2+...+t_n-1)*multinomial(t_1+t_2 +...+t_n,t_1,t_2,...,t_n). - Mircea Merca, Dec 06 2013
a(n+1) = Sum_{r=0..n} (2*r+1)*C(n,r). - J. M. Bergot, Apr 07 2014
a(n) = A007283(n)*n/6. - Enxhell Luzhnica, Apr 16 2016
a(n) = (A000225(n) + A000337(n))/2. - Anton Zakharov, Sep 17 2016
Sum_{n>0} (-1)^(n+1)/a(n) = 2*log(3/2) = 2*A016578. - Ilya Gutkovskiy, Sep 17 2016
a(n) = Sum_{k=0..n-1} Sum_{i=0..n-1} (i+1) * C(k,i). - Wesley Ivan Hurt, Sep 21 2017
a(n) = Sum_{i=1..n} Sum_{j=1..n} phi(i)*binomial(n, i*j). - Ridouane Oudra, Feb 17 2024

A003418 Least common multiple (or LCM) of {1, 2, ..., n} for n >= 1, a(0) = 1.

Original entry on oeis.org

1, 1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 27720, 27720, 360360, 360360, 360360, 720720, 12252240, 12252240, 232792560, 232792560, 232792560, 232792560, 5354228880, 5354228880, 26771144400, 26771144400, 80313433200, 80313433200, 2329089562800, 2329089562800
Offset: 0

Views

Author

Roland Anderson (roland.anderson(AT)swipnet.se)

Keywords

Comments

The minimal exponent of the symmetric group S_n, i.e., the least positive integer for which x^a(n)=1 for all x in S_n. - Franz Vrabec, Dec 28 2008
Product over all primes of highest power of prime less than or equal to n. a(0) = 1 by convention.
Also smallest number whose set of divisors contains an n-term arithmetic progression. - Reinhard Zumkeller, Dec 09 2002
An assertion equivalent to the Riemann hypothesis is: | log(a(n)) - n | < sqrt(n) * log(n)^2. - Lekraj Beedassy, Aug 27 2006. (This is wrong for n = 1 and n = 2. Should "for n large enough" be added? - Georgi Guninski, Oct 22 2011)
Corollary 3 of Farhi gives a proof that a(n) >= 2^(n-1). - Jonathan Vos Post, Jun 15 2009
Appears to be row products of the triangle T(n,k) = b(A010766) where b = A130087/A130086. - Mats Granvik, Jul 08 2009
Greg Martin (see link) proved that "the product of the Gamma function sampled over the set of all rational numbers in the open interval (0,1) whose denominator in lowest terms is at most n" equals (2*Pi)^(1/2)*a(n)^(-1/2). - Jonathan Vos Post, Jul 28 2009
a(n) = lcm(A188666(n), A188666(n)+1, ..., n). - Reinhard Zumkeller, Apr 25 2011
a(n+1) is the smallest integer such that all polynomials a(n+1)*(1^i + 2^i + ... + m^i) in m, for i=0,1,...,n, are polynomials with integer coefficients. - Vladimir Shevelev, Dec 23 2011
It appears that A020500(n) = a(n)/a(n-1). - Asher Auel, corrected by Bill McEachen, Apr 05 2024
n-th distinct value = A051451(n). - Matthew Vandermast, Nov 27 2009
a(n+1) = least common multiple of n-th row in A213999. - Reinhard Zumkeller, Jul 03 2012
For n > 2, (n-1) = Sum_{k=2..n} exp(a(n)*2*i*Pi/k). - Eric Desbiaux, Sep 13 2012
First column minus second column of A027446. - Eric Desbiaux, Mar 29 2013
For n > 0, a(n) is the smallest number k such that n is the n-th divisor of k. - Michel Lagneau, Apr 24 2014
Slowest growing integer > 0 in Z converging to 0 in Z^ when considered as profinite integer. - Herbert Eberle, May 01 2016
What is the largest number of consecutive terms that are all equal? I found 112 equal terms from a(370261) to a(370372). - Dmitry Kamenetsky, May 05 2019
Answer: there exist arbitrarily long sequences of consecutive terms with the same value; also, the maximal run of consecutive terms with different values is 5 from a(1) to a(5) (see link Roger B. Eggleton). - Bernard Schott, Aug 07 2019
Related to the inequality (54) in Ramanujan's paper about highly composite numbers A002182, also used in A199337: a(A329570(m))^2 is a (not minimal) bound above which all highly composite numbers are divisible by m, according to the right part of that inequality. - M. F. Hasler, Jan 04 2020
For n > 2, a(n) is of the form 2^e_1 * p_2^e_2 * ... * p_m^e_m, where e_m = 1 and e = floor(log_2(p_m)) <= e_1. Therefore, 2^e * p_m^e_m is a primitive Zumkeler number (A180332). Therefore, 2^e_1 * p_m^e_m is a Zumkeller number (A083207). Therefore, for n > 2, a(n) = 2^e_1 * p_m^e_m * r, where r is relatively prime to 2*p_m, is a Zumkeller number (see my proof at A002182 for details). - Ivan N. Ianakiev, May 10 2020
For n > 1, 2|(a(n)+2) ... n|(a(n)+n), so a(n)+2 .. a(n)+n are all composite and (part of) a prime gap of at least n. (Compare n!+2 .. n!+n). - Stephen E. Witham, Oct 09 2021

Examples

			LCM of {1,2,3,4,5,6} = 60. The primes up to 6 are 2, 3 and 5. floor(log(6)/log(2)) = 2 so the exponent of 2 is 2.
floor(log(6)/log(3)) = 1 so the exponent of 3 is 1.
floor(log(6)/log(5)) = 1 so the exponent of 5 is 1. Therefore, a(6) = 2^2 * 3^1 * 5^1 = 60. - _David A. Corneth_, Jun 02 2017
		

References

  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p. 365.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row products of A133233.
Cf. A025528 (number of prime factors of a(n) with multiplicity).
Cf. A275120 (lengths of runs of consecutive equal terms), A276781 (ordinal transform from term a(1)=1 onward).

Programs

  • Haskell
    a003418 = foldl lcm 1 . enumFromTo 2
    -- Reinhard Zumkeller, Apr 04 2012, Apr 25 2011
    
  • Magma
    [1] cat [Exponent(SymmetricGroup(n)) : n in [1..28]]; // Arkadiusz Wesolowski, Sep 10 2013
    
  • Magma
    [Lcm([1..n]): n in [0..30]]; // Bruno Berselli, Feb 06 2015
    
  • Maple
    A003418 := n-> lcm(seq(i,i=1..n));
    HalfFarey := proc(n) local a,b,c,d,k,s; a := 0; b := 1; c := 1; d := n; s := NULL; do k := iquo(n + b, d); a, b, c, d := c, d, k*c - a, k*d - b; if 2*a > b then break fi; s := s,(a/b); od: [s] end: LCM := proc(n) local i; (1/2)*mul(2*sin(Pi*i),i=HalfFarey(n))^2 end: # Peter Luschny
    # next Maple program:
    a:= proc(n) option remember; `if`(n=0, 1, ilcm(n, a(n-1))) end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Jun 10 2021
  • Mathematica
    Table[LCM @@ Range[n], {n, 1, 40}] (* Stefan Steinerberger, Apr 01 2006 *)
    FoldList[ LCM, 1, Range@ 28]
    A003418[0] := 1; A003418[1] := 1; A003418[n_] := A003418[n] = LCM[n,A003418[n-1]]; (* Enrique Pérez Herrero, Jan 08 2011 *)
    Table[Product[Prime[i]^Floor[Log[Prime[i], n]], {i, PrimePi[n]}], {n, 0, 28}] (* Wei Zhou, Jun 25 2011 *)
    Table[Product[Cyclotomic[n, 1], {n, 2, m}], {m, 0, 28}] (* Fred Daniel Kline, May 22 2014 *)
    a1[n_] := 1/12 (Pi^2+3(-1)^n (PolyGamma[1,1+n/2] - PolyGamma[1,(1+n)/2])) // Simplify
    a[n_] := Denominator[Sqrt[a1[n]]];
    Table[If[IntegerQ[a[n]], a[n], a[n]*(a[n])[[2]]], {n, 0, 28}] (* Gerry Martens, Apr 07 2018 [Corrected by Vaclav Kotesovec, Jul 16 2021] *)
  • PARI
    a(n)=local(t); t=n>=0; forprime(p=2,n,t*=p^(log(n)\log(p))); t
    
  • PARI
    a(n)=if(n<1,n==0,1/content(vector(n,k,1/k)))
    
  • PARI
    a(n)=my(v=primes(primepi(n)),k=sqrtint(n),L=log(n+.5));prod(i=1,#v,if(v[i]>k,v[i],v[i]^(L\log(v[i])))) \\ Charles R Greathouse IV, Dec 21 2011
    
  • PARI
    a(n)=lcm(vector(n,i,i)) \\ Bill Allombert, Apr 18 2012 [via Charles R Greathouse IV]
    
  • PARI
    n=1; lim=100; i=1; j=1; until(n==lim, a=lcm(j,i+1); i++; j=a; n++; print(n" "a);); \\ Mike Winkler, Sep 07 2013
    
  • Python
    from functools import reduce
    from operator import mul
    from sympy import sieve
    def integerlog(n,b): # find largest integer k>=0 such that b^k <= n
        kmin, kmax = 0,1
        while b**kmax <= n:
            kmax *= 2
        while True:
            kmid = (kmax+kmin)//2
            if b**kmid > n:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmin
    def A003418(n):
        return reduce(mul,(p**integerlog(n,p) for p in sieve.primerange(1,n+1)),1) # Chai Wah Wu, Mar 13 2021
    
  • Python
    # generates initial segment of sequence
    from math import gcd
    from itertools import accumulate
    def lcm(a, b): return a * b // gcd(a, b)
    def aupton(nn): return [1] + list(accumulate(range(1, nn+1), lcm))
    print(aupton(30)) # Michael S. Branicky, Jun 10 2021
  • Sage
    [lcm(range(1,n)) for n in range(1, 30)] # Zerinvary Lajos, Jun 06 2009
    
  • Scheme
    (define (A003418 n) (let loop ((n n) (m 1)) (if (zero? n) m (loop (- n 1) (lcm m n))))) ;; Antti Karttunen, Jan 03 2018
    

Formula

The prime number theorem implies that lcm(1,2,...,n) = exp(n(1+o(1))) as n -> infinity. In other words, log(lcm(1,2,...,n))/n -> 1 as n -> infinity. - Jonathan Sondow, Jan 17 2005
a(n) = Product (p^(floor(log n/log p))), where p runs through primes not exceeding n (i.e., primes 2 through A007917(n)). - Lekraj Beedassy, Jul 27 2004
Greg Martin showed that a(n) = lcm(1,2,3,...,n) = Product_{i = Farey(n), 0 < i < 1} 2*Pi/Gamma(i)^2. This can be rewritten (for n > 1) as a(n) = (1/2)*(Product_{i = Farey(n), 0 < i <= 1/2} 2*sin(i*Pi))^2. - Peter Luschny, Aug 08 2009
Recursive formula useful for computations: a(0)=1; a(1)=1; a(n)=lcm(n,a(n-1)). - Enrique Pérez Herrero, Jan 08 2011
From Enrique Pérez Herrero, Jun 01 2011: (Start)
a(n)/a(n-1) = A014963(n).
if n is a prime power p^k then a(n)=a(p^k)=p*a(n-1), otherwise a(n)=a(n-1).
a(n) = Product_{k=2..n} (1 + (A007947(k)-1)*floor(1/A001221(k))), for n > 1. (End)
a(n) = A079542(n+1, 2) for n > 1.
a(n) = exp(Sum_{k=1..n} Sum_{d|k} moebius(d)*log(k/d)). - Peter Luschny, Sep 01 2012
a(n) = A025529(n) - A027457(n). - Eric Desbiaux, Mar 14 2013
a(n) = exp(Psi(n)) = 2 * Product_{k=2..A002088(n)} (1 - exp(2*Pi*i * A038566(k+1) / A038567(k))), where i is the imaginary unit, and Psi the second Chebyshev's function. - Eric Desbiaux, Aug 13 2014
a(n) = A064446(n)*A038610(n). - Anthony Browne, Jun 16 2016
a(n) = A000142(n) / A025527(n) = A000793(n) * A225558(n). - Antti Karttunen, Jun 02 2017
log(a(n)) = Sum_{k>=1} (A309229(n, k)/k - 1/k). - Mats Granvik, Aug 10 2019
From Petros Hadjicostas, Jul 24 2020: (Start)
Nair (1982) proved that 2^n <= a(n) <= 4^n for n >= 9. See also Farhi (2009). Nair also proved that
a(n) = lcm(m*binomial(n,m): 1 <= m <= n) and
a(n) = gcd(a(m)*binomial(n,m): n/2 <= m <= n). (End)
Sum_{n>=1} 1/a(n) = A064859. - Bernard Schott, Aug 24 2020
Previous Showing 11-20 of 2305 results. Next