Massimo Nocentini

January 30, 2017: refactoring
September 12, 2016: search hints, table data representation
September 7, 2016: module encapsulation, refactoring and filtering
September 6, 2016: pretty printer
September 5, 2016: big bang


Abstract
A pretty printer for OEIS search result, make them inline in the notebook.

A pretty printer for OEIS search results

Our idea to integrate OEIS search results in a working notebook lies on a existing attempt to talk with http://oeis.org, under review in this Stack Overflow thread. Evaluate the following cell to work with most recent definitions according to version history:


In [1]:
from pprinting import search

Instead, for debug and develop sessions evaluate the following one:


In [15]:
%run ../src/


ERROR:root:File `'../src/.py'` not found.

Search hints

OEIS provide a page full of search hints. In order to gain performance and search capabilities already provided by the online encyclopedia, we show how to use those hints with our implementation.

The following content is kept from the Advanced search syntax section of the reference page:

  • Examples of searches

       1,4,9,16,25,36,64
       5 8 13 233 39088169
       "fermat's little theorem"
       author:Guy keyword:nice
       keyword:nice keyword:more -keyword:base
       keyword:new -keyword:base
       id:A64413
       A64413
       id:A028284|id:A066948
       author:njas keyword:less|keyword:dumb
    • The search text is a list of space-separated search terms, as with popular web search engines.
    • The search terms can be single numbers, sequences of numbers, words or strings of words.
    • Sequences of numbers should be separated with commas.
    • Strings of words should be separated by spaces (NOT commas).
    • Strings of words may be enclosed in double quotes.
    • You can separate search terms with | (no spaces around the |) and it means sequences that match either term.
  • Commas versus spaces
    Commas and spaces have different meanings. These two searches produce different results:

       1,4,9,16,25,36,49,64,81,100
       1 4 9 16 25 36 49 64 81 100

    The first matches sequences in which the numbers appear consecutively, in the order given.
    The second matches sequences containing all the numbers, in any order.
    Both searches will match the squares (A000290), but the second will also match other sequences, such as the composite numbers (A002808), which contain all those numbers but not necessarily consecutively or in the given order.
    The same is true for word searches. Suppose you want to find sequences that cite Stanley's book Enumerative Combinatorics.
    The search string Stanley, Combinatorics (with the comma) gets no hits, but searching for Stanley Combinatorics (without the comma) gets several hundred hits.

  • Prefixes
    Simple search terms will be matched against every field of the entry, though fields such as the name and the sequence data are given more weight than others. Prefixes restrict the search to particular lines, as in:

       keyword:nice author:LeBrun

    The prefixes mostly correspond to the lines in the display, as follows:

       id:                     ref:                    program:
       seq:                    link:                   xref:
       signed:                 formula:                keyword:
       name:                   example:                author:
       offset:                 maple:                  extension:
       comment:                mathematica:
    • id:A001006 displays sequence A001006. A001006 displays sequence A001006 followed by all other sequences that mention it.
    • seq: matches the sequence data, possibly by ignoring signs.
    • signed: matches sequence data and requires that any signs match as well. For example: signed:1,-1,-1,0,-1,1,-1,0,0,1,-1,0,-1,1,1,0 will find the Moebius function mu(n), A008683.
    • Put a minus sign in front of a prefix to exclude those matches. Put a tilde (~) in front of a number to exclude it (only applies if the numbers are separated by spaces). For example, a search for 2 4 ~8 16 returns sequences such as 0, 1, 2, 4, 16, 65536 that do not contain 8.
    • You can say prefix: by itself to match sequences that have a line of that type. For example ref: will match all sequences with reference lines.
    • Another example: you can say, e.g. -seq:5 in your search to exclude all sequences containing the number 5. So if you know your sequence consists only of 1, 2, 3, and 4 (and does include all of them), you could search seq:1 seq:2 seq:3 seq:4 -seq:5 -seq:6 -seq:0.

    Two other prefixes are concerned with subsequences:

       subseq:                 signedsubseq:

    You can say, for example, subseq:377,8 to get those numbers in sequence data in that order.

  • Wild cards

    • The wildcard _ will match any number in a sequence, as in 1,2,_,4,5
    • The wildcard __ will match any list of numbers in a sequence, as in 1,2,__,7,8
    • Search terms are highlighted in the results
  • Punctuation
    is not indexed and is treated as identical to whitespace during matching; for example, searching for fermat's is the same as searching for "fermat s".

  • Further examples
    To find sequences containing both terms 1759 and 1957: search for seq:1759 seq:1957.

Use cases


In [15]:
from functools import partial

# the following is a simple hack because if we try to use the cache it raises an exception :S
search = partial(search, cache_info={'cache_dir':'./fetched/', 'cache_first':False})

Search by sequence identifier


In [16]:
searchable = search(A_id='A000045')



In [17]:
searchable(data_only=True, comment=lambda i,c: "binomial" in c)


Out[17]:

Results for query: https://oeis.org/search?fmt=json&start=0&q=id%3AA000045


A000045: Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.

by N. J. A. Sloane, 1964

Keywords: nonn,core,nice,easy,hear,changed

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A000045(n) & 0 & 1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 & 144 & 233 & 377 \end{array} $$

In [18]:
searchable = search(A_id='A000045')



In [19]:
searchable(comment=lambda i,c: "binomial" in c, formula=lambda i,f:False)


Out[19]:

Results for query: https://oeis.org/search?fmt=json&start=0&q=id%3AA000045


A000045: Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.

by N. J. A. Sloane, 1964

Keywords: nonn,core,nice,easy,hear,changed

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A000045(n) & 0 & 1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 & 144 & 233 & 377 \end{array} $$

Comments:

  • F(n+2) = Sum_{k=0..n} binomial(floor((n+k)/2),k), row sums of A046854. - Paul Barry, Mar 11 2003
  • The sequence F(n) is the binomial transformation of the alternating sequence (-1)^(n-1)F(n), whereas the sequence F(n+1) is the binomial transformation of the alternating sequence (-1)^nF(n-1). Both of these facts follow easily from the equalities a(n;1)=F(n+1) and b(n;1)=F(n) where a(n;d) and b(n;d) are so-called "delta-Fibonacci" numbers as defined in comments to A014445 (see also the papers of Witula et al.). - Roman Witula, Jul 24 2012
    • Let P(x) = x/(1+x) with comp. inverse Pinv(x) = x/(1-x) = -P[-x], and C(x)= [1-sqrt(1-4x)]/2, an o.g.f. for the shifted Catalan numbers A000108, with inverse Cinv(x) = x * (1-x).
    • Fin(x) = P[C(x)] = C(x)/[1 + C(x)] is an o.g.f. for the Fine numbers, A000957 with inverse Fin^(-1)(x) = Cinv[Pinv(x)] = Cinv[-P(-x)].
    • Mot(x) = C[P(x)] = C[-Pinv(-x)] gives an o.g.f. for shifted A005043, the Motzkin or Riordan numbers with comp. inverse Mot^(-1)(x) = Pinv[Cinv(x)] = (x - x^2) / (1 - x + x^2) (cf. A057078).
    • BTC(x) = C[Pinv(x)] gives A007317, a binomial transform of the Catalan numbers, with BTC^(-1)(x) = P[Cinv(x)].
    • Fib(x) = -Fin[Cinv(Cinv(-x))] = -P[Cinv(-x)] = x + 2 x^2 + 3 x^3 + 5 x^4 + ... = (x+x^2)/[1-x-x^2] is an o.g.f. for the shifted Fibonacci sequence A000045, so the comp. inverse is Fib^(-1)(x) = -C[Pinv(-x)] = -BTC(-x) and Fib(x) = -BTC^(-1)(-x).
    • Generalizing to P(x,t) = x /(1 + tx) and Pinv(x,t) = x /(1 - tx) = -P(-x,t) gives other relations to lattice paths, such as the o.g.f. for A091867, C[P[x,1-t]], and that for A104597, Pinv[Cinv(x),t+1].

Cross references:

Search by sequence of numbers


In [20]:
searchable = search(seq=[1,1,2,5,14,42, 132, 429], max_results=4)



In [24]:
searchable(data_only=True)


Out[24]:

Results for query: https://oeis.org/search?fmt=json&start=0&q=1%2C+1%2C+2%2C+5%2C+14%2C+42%2C+132%2C+429


A000108: Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). Also called Segner numbers.

by N. J. A. Sloane

Keywords: core,nonn,easy,eigen,nice

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A000108(n) & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4862 & 16796 & 58786 & 208012 & 742900 & 2674440 \end{array} $$


A120588: G.f. satisfies: 3*A(x) = 2 + x + A(x)^2, with a(0) = 1.

by Paul D. Hanna, Jun 16 2006, Jan 24 2008

Keywords: nonn,easy

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A120588(n) & 1 & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4862 & 16796 & 58786 & 208012 & 742900 \end{array} $$


A211216: Expansion of (1-8*x+21*x^2-20*x^3+5*x^4)/(1-9*x+28*x^2-35*x^3+15*x^4-x^5).

by Bruno Berselli, May 11 2012

Keywords: nonn,easy

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A211216(n) & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4862 & 16795 & 58766 & 207783 & 740924 & 2660139 \end{array} $$


A033191: Binomial transform of [ 1, 0, 1, 1, 3, 6, 15, 36, 91, 231, 595,... ], which is essentially binomial(fibonacci(k) + 1, 2).

by Simon P. Norton (simon(AT)dpmms.cam.ac.uk)

Keywords: nonn,easy

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A033191(n) & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4861 & 16778 & 58598 & 206516 & 732825 & 2613834 \end{array} $$

In [23]:
searchable(comment=lambda i,c: i in range(10))


Out[23]:

Results for query: https://oeis.org/search?fmt=json&start=0&q=1%2C+1%2C+2%2C+5%2C+14%2C+42%2C+132%2C+429


A000108: Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). Also called Segner numbers.

by N. J. A. Sloane

Keywords: core,nonn,easy,eigen,nice

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A000108(n) & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4862 & 16796 & 58786 & 208012 & 742900 & 2674440 \end{array} $$

Comments:

  • The solution to Schröder's first problem. A very large number of combinatorial interpretations are known - see references, esp. Stanley, Enumerative Combinatorics, Volume 2. This is probably the longest entry in the OEIS, and rightly so.
  • Number of ways to insert n pairs of parentheses in a word of n+1 letters. E.g., for n=2 there are 2 ways: ((ab)c) or (a(bc)); for n=3 there are 5 ways: ((ab)(cd)), (((ab)c)d), ((a(bc))d), (a((bc)d)), (a(b(cd))).
  • Consider all the binomial(2n,n) paths on squared paper that (i) start at (0, 0), (ii) end at (2n, 0) and (iii) at each step, either make a (+1,+1) step or a (+1,-1) step. Then the number of such paths that never go below the x-axis (Dyck paths) is C(n). [Chung-Feller]
  • Number of noncrossing partitions of the n-set. For example, of the 15 set partitions of the 4-set, only [{13},{24}] is crossing, so there are a(4)=14 noncrossing partitions of 4 elements. - Joerg Arndt, Jul 11 2011
  • a(n-1) is the number of ways of expressing an n-cycle in the symmetric group S_n as a product of n-1 transpositions (u_1,v_1)(u_2,v_2)...*(u{n-1},v{n-1}) where u_k <= u_j and v_k <= v_j for k < j; see example. If the condition is dropped, one obtains A000272. - Joerg Arndt and Greg Stevenson, Jul 11 2011
  • a(n) is the number of ordered rooted trees with n nodes, not including the root. See the Conway-Guy reference where these rooted ordered trees are called plane bushes. See also the Bergeron et al. reference, Example 4, p. 167. - Wolfdieter Lang, Aug 07 2007
  • As shown in the paper from Beineke and Pippert (1971), a(n-2)=D(n) is the number of labeled dissections of a disk, related to the number R(n)=A001761(n-2) of labeled planar 2-trees having n vertices and rooted at a given exterior edge, by the formula D(n)=R(n)/(n-2)!. - M. F. Hasler, Feb 22 2012
  • Shifts one place left when convolved with itself.
  • For n >= 1 a(n) is also the number of rooted bicolored unicellular maps of genus 0 on n edges. - Ahmed Fares (ahmedfares(AT)my-deja.com), Aug 15 2001
  • Ways of joining 2n points on a circle to form n nonintersecting chords. (If no such restriction imposed, then ways of forming n chords is given by (2n-1)!!=(2n)!/n!2^n=A001147(n).)

Formulae:

  • a(n) = A000984(n)/(n+1) = binomial(2n, n)/(n+1) = (2n)!/(n!*(n+1)!).
  • a(n) = binomial(2n, n) - binomial(2n, n-1).
  • a(n) = Sum_{k=0..n-1} a(k)a(n-1-k).
  • a(n) = Product_{k=2..n} (1 + n/k), if n>1.
  • G.f.: A(x) = (1 - sqrt(1 - 4x)) / (2x). G.f. A(x) satisfies A = 1 + x*A^2.
  • a(n+1) = Sum_{i} binomial(n, 2i)2^(n-2i)a(i). - Touchard
  • 2(2n-1)a(n-1) = (n+1)a(n).
  • It is known that a(n) is odd if and only if n=2^k-1, k=0, 1, 2, 3, ... - Emeric Deutsch, Aug 04 2002, corrected by M. F. Hasler, Nov 08 2015
  • Using the Stirling approximation in A000142 we get the asymptotic expansion a(n) ~ 4^n / (sqrt(Pi n) (n + 1)). - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 13 2001
  • Integral representation: a(n) = int(x^nsqrt((4-x)/x), x=0..4)/(2Pi). - Karol A. Penson, Apr 12 2001
  • E.g.f.: exp(2x)(I_0(2x)-I_1(2x)), where I_n is Bessel function. - Karol A. Penson, Oct 07 2001
  • Polygorial(n, 6)/Polygorial(n, 3). - Daniel Dockery (peritus(AT)gmail.com), Jun 24 2003
  • G.f. A(x) satisfies ((A(x) + A(-x)) / 2)^2 = A(4*x^2). - Michael Somos, Jun 27, 2003
  • G.f. A(x) satisfies Sum{k>=1} k(A(x)-1)^k = Sum{n >= 1} 4^{n-1}*x^n. - Shapiro, Woan, Getu
  • a(n+m) = Sum_{k} A039599(n, k)*A039599(m, k). - Philippe Deléham, Dec 22 2003
  • a(n+1) = (1/(n+1))Sum_{k=0..n} a(n-k)binomial(2k+1, k+1). - Philippe Deléham, Jan 24 2004
  • a(n) = Sum_{k>=0} A008313(n, k)^2. - Philippe Deléham, Feb 14 2004
  • a(m+n+1) = Sum_{k>=0} A039598(m, k)*A039598(n, k). - Philippe Deléham, Feb 15 2004
  • C(n-1) = binomial(2n-2,n-1)/n = (1/n!) [ n^(n-1) + ( binomial(n-2,1) + binomial(n-2,2) )n^(n-2) + ( 2binomial(n-3,1) + 7binomial(n-3,2) + 8binomial(n-3,3) + 3binomial(n-3,4) )n^(n-3) + ( 6binomial(n-4,1) + 38binomial(n-4,2) + 93binomial(n-4,3) + 111binomial(n-4,4) + 65binomial(n-4,5) + 15binomial(n-4,6) )*n^(n-4) + ... ]. - André F. Labossière, Nov 10 2004, corrected by M. F. Hasler, Nov 10 2015
  • a(n) = Sum_{k=0..n} (-1)^k2^(n-k)binomial(n, k)*binomial(k, floor(k/2)). - Paul Barry, Jan 27 2005
  • Sum_{n>=0} 1/a(n) = 2 + 4*Pi/3^(5/2) = F(1,2;1/2;1/4) = 2.806133050770763... (see L'Univers de Pi link). - Gerald McGarvey and Benoit Cloitre, Feb 13 2005
  • a(n) = Sum{k=0..floor(n/2)} ((n-2k+1)binomial(n, n-k)/(n-k+1))^2, which is equivalent to: a(n) = Sum{k=0..n} A053121(n, k)^2, for n>=0. - Paul D. Hanna, Apr 23 2005
  • a((m+n)/2) = Sum_{k>=0} A053121(m, k)*A053121(n, k) if m+n is even. - Philippe Deléham, May 26 2005
  • E.g.f. Sum_{n>=0} a(n) x^(2n) / (2n)! = BesselI(1, 2x) / x. - Michael Somos, Jun 22 2005
  • Given g.f. A(x), then B(x) = x A(x^3) satisfies 0 = f(x, B(X)) where f(u, v) = u - v + (uv)^2 or B(x) = x + (x * B(x))^2 which implies B(-B(x)) = -x and also (1 + B^3) / B^2 = (1 - x^3) / x^2. - Michael Somos, Jun 27 2005
  • a(n) = a(n-1)(4-6/(n+1)). a(n) = 2a(n-1)(8a(n-2)+a(n-1))/(10a(n-2)-a(n-1)).
    • Franklin T. Adams-Watters, Feb 08 2006
  • Sum_{k>=1} a(k)/4^k = 1. - Franklin T. Adams-Watters, Jun 28 2006
  • a(n) = A047996(2*n+1, n). - Philippe Deléham, Jul 25 2006
  • Binomial transform of A005043. - Philippe Deléham, Oct 20 2006
  • a(n) = Sum_{k=0..n} (-1)^k*A116395(n,k). - Philippe Deléham, Nov 07 2006
  • a(n) = (1/(s-n))Sum_{k=0..n} (-1)^k (k+s-n)binomial(s-n,k) * binomial(s+n-k,s) with s a nonnegative free integer [H. W. Gould].
  • a(k) = Sum_{i=1..k} |A008276(i,k)| * (k-1)^(k-i) / k!. - André F. Labossière, May 29 2007
  • a(n) = Sum_{k=0..n} A129818(n,k) * A007852(k+1). - Philippe Deléham, Jun 20 2007
  • a(n) = Sum_{k=0..n} A109466(n,k) * A127632(k). - Philippe Deléham, Jun 20 2007
  • Row sums of triangle A124926. - Gary W. Adamson, Oct 22 2007
  • Lim{n->infinity}(1+Sum{k=0..n}a(k)/A004171(k)) = 4/Pi. - Reinhard Zumkeller, Aug 26 2008
  • a(n) = Sum{k=0..n} A120730(n,k)^2 and a(k+1) = Sum{n>=k} A120730(n,k). - Philippe Deléham, Oct 18 2008
  • Given an integer t >= 1 and initial values u = [a_0, a1, ..., a{t-1}], we may define an infinite sequence Phi(u) by setting an = a{n-1} + a0*a{n-1}
    • a1*a{n-2} + ... + a_{n-2}*a_1 for n >= t. For example, the present sequence is Phi([1]) (also Phi([1,1])). - Gary W. Adamson, Oct 27 2008
  • a(n) = Sum_{l1=0..n+1} Sum{l2=0..n}...Sum{li=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 li < l(i+1) and l_(i+1) <> 0 for i=1..n-1 and delta(l_1,l_2,...,l_i,...,l_n) = 1 otherwise. - Thomas Wieder, Feb 25 2009
  • Let A(x) be the g.f., then B(x)=xA(x) satisfies the differential equation B'(x)-2B'(x)*B(x)-1=0. - Vladimir Kruchinin, Jan 18 2011
  • G.f.: 1/(1-x/(1-x/(1-x/(...)))) (continued fraction). - Joerg Arndt, Mar 18 2011
  • With F(x) = (1-2x-sqrt(1-4x))/(2*x) an o.g.f. in x for the Catalan series, G(x) = x/(1+x)^2 is the compositional inverse of F (nulling the n=0 term). - Tom Copeland, Sep 04 2011
  • With H(x) = 1/(dG(x)/dx) = (1+x)^3 / (1-x), the n-th Catalan number is given by (1/n!)((H(x)d/dx)^n)x evaluated at x=0, i.e., F(x) = exp(xH(u)d/du)u, evaluated at u = 0. Also, dF(x)/dx = H(F(x)), and H(x) is the o.g.f. for A115291. - Tom Copeland, Sep 04 2011
  • With F(x) = {1-sqrt[1-4x]}/2 an o.g.f. in x for the Catalan series, G(x)= x(1-x) is the compositional inverse and this relates the Catalan numbers to the row sums of A125181. - Tom Copeland, Sep 30 2011
  • With H(x)=1/(dG(x)/dx)= 1/(1-2x), the n-th Catalan number (offset 1) is given by (1/n!)((H(x)d/dx)^n)x evaluated at x=0, i.e., F(x) = exp(xH(u)d/du)u, evaluated at u = 0. Also, dF(x)/dx = H(F(x)). - Tom Copeland, Sep 30 2011
  • G.f.: (1-sqrt(1-4x))/(2x)=G(0) where G(k)=1+(4k+1)x/(k+1-2x(k+1)(4k+3)/(2x(4k+3)+(2k+3)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 30 2011
  • E.g.f.: exp(2x)(BesselI(0,2x)-BesselI(1,2x))=G(0) where G(k)=1+(4k+1)x/((k+1)(2k+1)-x(k+1)(2k+1)(4k+3)/(x(4k+3)+(k+1)(2*k+3)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Nov 30 2011
  • E.g.f.: Hypergeometric([1/2],[2],4*x) which coincides with the e.g.f. given just above, and also by Karol A. Penson further above. - Wolfdieter Lang, Jan 13 2012
  • a(n) = A208355(2n-1) = A208355(2n) for n > 0. - Reinhard Zumkeller, Mar 04 2012
  • G.f.: 1 + 2x/(U(0)-2x) where U(k)= k(4x+1) + 2x + 2 - x(2k+3)(2*k+4)/U(k+1); (continued fraction, Euler's 1st kind, 1-step). - Sergei N. Gladkovskii, Sep 20 2012
  • G.f.: hypergeom([1/2,1],[2],4*x). - Joerg Arndt, Apr 06 2013
  • Special values of Jacobi polynomials, in Maple notation: a(n) = 4^n*JacobiP(n,1,-1/2-n,-1)/(n+1). - Karol A. Penson, Jul 28 2013
  • For n > 0: a(n) = sum of row n in triangle A001263. - Reinhard Zumkeller, Oct 10 2013
  • a(n) = binomial(2n,n-1)/n and a(n) mod n = binomial(2n,n) mod n = A059288(n).
    • Jonathan Sondow, Dec 14 2013
  • a(n-1) = sum(t1+2t2+...+ntn=n, (-1)^(1+t1+t2+...+tn)multinomial(t1+t2 +...+tn,t1,t2,...,tn)a(1)^t1a(2)^t2...*a(n)^tn). - Mircea Merca, Feb 27 2014
  • a(n) = sum_{k=1..n} binomial(n+k-1,n)/n if n>0. Alexander Adamchuk, Mar 25 2014
  • a(n) = -2^(2n+1) binomial(n-1/2, -3/2). - Peter Luschny, May 06 2014
  • a(n) = (4*A000984(n)-A000984(n+1))/2. - Stanislav Sykora, Aug 09 2014
  • a(n) = A246458(n) * A246466(n). - Tom Edgar, Sep 02 2014
  • a(n) = (2n)![x^(2*n)]hypergeom([],[2],x^2). - Peter Luschny, Jan 31 2015
  • a(n) = 4^(n-1)*hypergeom([3/2, 1-n], [3], 1). - Peter Luschny, Feb 03 2015
  • a(2n) = 2A000150(2n); a(2n+1) = 2A000150(2n+1) + a(n). - John Bodeen, Jun 24 2015
  • a(n) = Sum{t=1, n+1} n^(t-1)*abs(stirling1(n+1, t)) / Sum{t=1, n+1} abs(stirling1(n+1, t)), for n > 0, see (10) in Cereceda link. - Michel Marcus, Oct 06 2015
  • a(n) ~ 4^(n-2)(128 + 160/N^2 + 84/N^4 + 715/N^6 - 10180/N^8)/(N^(3/2)Pi^(1/2)) where N = 4*n+3. - Peter Luschny, Oct 14 2015
  • a(n) = Sum_{k=1..floor((n+1)/2)} (-1)^(k-1)binomial(n+1-k,k)a(n-k) if n > 0; and a(0) = 1. - David Pasino, Jun 29 2016
  • Sum_{n>=0} (-1)^n/a(n) = 14/25 - 24arccsch(2)/(25sqrt(5)) = 14/25 - 24A002390/(25sqrt(5)) = 0.353403708337278061333... - Ilya Gutkovskiy, Jun 30 2016
  • C(n) = (1/n) Sum_{i+j+k=n-1} C(i)C(j)C(k)(k+1), n >= 1. - Yuchun Ji, Feb 21 2016
  • C(n) = 1 + Sum(C(i)C(j)C(k), i+j+k<n-1). - Yuchun Ji, Sep 01 2016
  • a(n) = A001700(n) - A162551(n) = binomial(2n+1,n+1) - 2binomial(2*n,n-1). - Taras Goy, Aug 09 2018

Cross references:


A120588: G.f. satisfies: 3*A(x) = 2 + x + A(x)^2, with a(0) = 1.

by Paul D. Hanna, Jun 16 2006, Jan 24 2008

Keywords: nonn,easy

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A120588(n) & 1 & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4862 & 16796 & 58786 & 208012 & 742900 \end{array} $$

Comments:

  • This is essentially a duplicate of entry A000108, the Catalan numbers (a(n) = A000108(n-1) for n>0).
  • In order for the g.f. of an integer sequence to satisfy a functional equation of the form: rA(x) = c + bx + A(x)^n, where n > 1, it is necessary that the sequence start with [1, d, mn(n-1)/2], where d divides mn(n-1)/2 (m>0) and that the coefficients are given by r = n + d^2/m, c = r-1 and b = d^3/m. The remaining terms may then be integer and still satisfy: a_n(k) = r*a(k), where a_n(k) is the k-th term of the n-th self-convolution of the sequence.

Formulae:

  • G.f.: A(x) = 1 + Series_Reversion(1+3*x - (1+x)^2).
  • Lagrange Inversion yields g.f.: A(x) = Sum_{n>=0} C(2n,n)/(n+1)(2+x)^(n+1)/3^(2*n+1).
  • G.f.: (3 - sqrt(1-4*x))/2. - Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009
  • a(n) = Sum_{k=1..n-1} a(k) * a(n-k) if n>1. - Michael Somos, Jul 23 2011
  • G.f.: 2 - G(0), where G(k)= 2x(2k+1) + k +1 - 2x(k+1)(2*k+3)/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Jul 14 2013
  • G.f.: 2 - G(0), where G(k)= 1 - x/G(k+1) ; (continued fraction). - Sergei N. Gladkovskii, Jul 19 2013
  • a(n) ~ 2^(2n-2)/(sqrt(Pi)n^(3/2)). - Vaclav Kotesovec, Aug 19 2013
  • Given g.f. A(x), A001850(n-1) = coefficient of x^n in A(x)^n if n>0, the derivative of log(A(x)) is the g.f. for A026641. - Michael Somos, May 18 2015
  • A(x) = (1 + 2Sum_{n >= 1} Catalan(n)x^n)/(1 + Sum{n >= 1} Catalan(n)x^n) = (1 + 3/2Sum{n >= 1} binomial(2n,n)x^n )/(1 + Sum_{n >= 1} binomial(2n,n)x^n). - Peter Bala, Sep 01 2016

Cross references:


A211216: Expansion of (1-8*x+21*x^2-20*x^3+5*x^4)/(1-9*x+28*x^2-35*x^3+15*x^4-x^5).

by Bruno Berselli, May 11 2012

Keywords: nonn,easy

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A211216(n) & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4862 & 16795 & 58766 & 207783 & 740924 & 2660139 \end{array} $$

Comments:

  • In the paper of Kitaev, Remmel and Tiefenbruck (see the Links section), Q_(132)^(k,0,0,0)(x,0) represents a generating function depending on k and x.
  • For successive values ​​of k we have:
  • k=1, the g.f. of A000012: 1/(1-x);
  • k=2, " A011782: (1-x)/(1-2*x);
  • k=3, " A001519: (1-2x)/(1-3x+x^2);
  • k=4, " A124302: (1-3x+x^2)/(1-4x+3*x^2);
  • k=5, " A080937: (1-4x+3x^2)/(1-5x+6x^2-x^3);
  • k=6, " A024175: (1-5x+6x^2-x^3)/(1-6x+10x^2-4*x^3);
  • k=7, " A080938: (1-6x+10x^2-4x^3)/(1-7x+15x^2-10x^3+x^4);
  • k=8, " A033191: (1-7x+15x^2-10x^3+x^4)/(1-8x+21*x^2

Formulae:

  • G.f.: (1-3x+x^2)(1-5x+5x^2)/(1-9x+28x^2-35x^3+15x^4-x^5).
  • G.f.: 1/(1-x/(1-x/(1-x/(1-x/(1-x/(1-x/(1-x/(1-x/(1-x))))))))). - Philippe Deléham, Mar 14 2013

Cross references:


A033191: Binomial transform of [ 1, 0, 1, 1, 3, 6, 15, 36, 91, 231, 595,... ], which is essentially binomial(fibonacci(k) + 1, 2).

by Simon P. Norton (simon(AT)dpmms.cam.ac.uk)

Keywords: nonn,easy

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A033191(n) & 1 & 1 & 2 & 5 & 14 & 42 & 132 & 429 & 1430 & 4861 & 16778 & 58598 & 206516 & 732825 & 2613834 \end{array} $$

Comments:

  • Number of (s(0), s(1), ..., s(2n)) such that 0 < s(i) < 10 and |s(i) - s(i-1)| = 1 for i = 1,2,....,2n, s(0) = 1, s(2n) = 1. - Herbert Kociemba, Jun 14 2004
  • The sequence 1,2,5,14,... has g.f. 1/(1-2x-x^2/(1-2x-x^2/(1-2x-x^2/(1-2x)))) = (1-6x+10x^2-4x^3)/(1-8x+21x^2-20x^3+5x^4), and is the second binomial transform A001519 aerated. - Paul Barry, Dec 17 2009
  • Counts all paths of length (2*n), n>=0, starting and ending at the initial node on the path graph P_9, see the Maple program. - Johannes W. Meijer, May 29 2010

Formulae:

  • G.f.: (1-7x+15x^2-10x^3+x^4)/(1-8x+21x^2-20x^3+5x^4). - Ralf Stephan, May 13 2003
  • a(n) = (1/5)sum(r, 1, 9, sin(rPi/10)^2(2cos(rPi/10))^(2n)), n>=1; a(n) = 8a(n-1)-21a(n-2)+20a(n-3)-5a(n-4), n>=5. - Herbert Kociemba, Jun 14 2004
  • G.f.: 1 / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x / (1 - x )))))))). - Michael Somos, May 12 2012

Cross references:

Search by open content


In [28]:
searchable = search(query="pascal", table=True)



In [30]:
searchable(comment=lambda i,c: i in range(5))


Out[30]:

Results for query: https://oeis.org/search?fmt=json&start=0&q=pascal+keyword%3Atabl


A007318: Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n.

by N. J. A. Sloane and Mira Bernstein, Apr 28 1994

Keywords: nonn,tabl,nice,easy,core,look,hear

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 1 & 1 & & & & & & & & \\2 & 1 & 2 & 1 & & & & & & & \\3 & 1 & 3 & 3 & 1 & & & & & & \\4 & 1 & 4 & 6 & 4 & 1 & & & & & \\5 & 1 & 5 & 10 & 10 & 5 & 1 & & & & \\6 & 1 & 6 & 15 & 20 & 15 & 6 & 1 & & & \\7 & 1 & 7 & 21 & 35 & 35 & 21 & 7 & 1 & & \\8 & 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 & \\9 & 1 & 9 & 36 & 84 & 126 & 126 & 84 & 36 & 9 & 1 \end{array} $$

Comments:

  • C(n,k) = number of k-element subsets of an n-element set.
  • Row n gives coefficients in expansion of (1+x)^n.
  • Binomial(n+k-1,n-1) is the number of ways of placing k indistinguishable balls into n boxes (the "bars and stars" argument - see Feller).
  • Binomial(n-1,k-1) is the number of compositions (ordered partitions) of n with k summands.
  • Binomial(n+k-1,k-1) is the number of weak compositions (ordered weak partitions) of n into exactly k summands. - Juergen Will, Jan 23 2016

Formulae:

  • a(n, k) = C(n,k) = binomial(n, k).
  • C(n, k) = C(n-1, k) + C(n-1, k-1).
  • The triangle is symmetric: C(n,k) = C(n,n-k).
  • a(n+1, m) = a(n, m) + a(n, m-1), a(n, -1) := 0, a(n, m) := 0, n<m; a(0, 0)=1.
  • C(n, k)=n!/(k!(n-k)!) if 0<=k<=n, otherwise 0.
  • G.f.: 1/(1-y-xy) = Sum(C(n, k)x^k*y^n, n, k>=0)
  • G.f.: 1/(1-x-y) = Sum(C(n+k, k)x^ky^n, n, k>=0).
  • G.f. for row n: (1+x)^n = Sum_{k=0..n} C(n, k)x^k.
  • G.f. for column n: x^n/(1-x)^n.
  • E.g.f.: A(x, y) = exp(x+x*y).
  • E.g.f. for column n: x^n*exp(x)/n!.
  • In general the m-th power of A007318 is given by: T(0, 0) = 1, T(n, k) = T(n-1, k-1) + m*T(n-1, k), where n is the row-index and k is the column; also T(n, k) = m^(n-k) C(n, k).
  • Triangle T(n, k) read by rows; given by A000007 DELTA A000007, where DELTA is Deléham's operator defined in A084938.
  • Let P(n+1) = the number of integer partitions of (n+1); let p(i) = the number of parts of the i-th partition of (n+1); let d(i) = the number of different parts of the i-th partition of (n+1); let m(i, j) = multiplicity of the j-th part of the i-th partition of (n+1). Define the operator Sum{i=1..P(n+1), p(i)=k+1} as the sum running from i=1 to i=P(n+1) but taking only partitions with p(i)=(k+1) parts into account. Define the operator Product{j=1..d(i)} = product running from j=1 to j=d(i). Then C(n, k) = Sum{p(i)=(k+1), i=1..P(n+1)} p(i)! / [Product{j=1..d(i)} m(i, j)!]. E.g., C(5, 3) = 10 because n=6 has the following partitions with m=3 parts: (114), (123), (222). For their multiplicities one has: (114): 3!/(2!1!) = 3; (123): 3!/(1!1!*1!) = 6; (222): 3!/3! = 1. The sum is 3 + 6 + 1 = 10 = C(5, 3). - Thomas Wieder, Jun 03 2005
  • C(n, k) = Sum_{j=0..k} = (-1)^jC(n+1+j, k-j)A000108(j). - Philippe Deléham, Oct 10 2005
  • G.f.: 1 + x(1 + x) + x^3(1 + x)^2 + x^6(1 + x)^3 + ... . - Michael Somos, Sep 16 2006
  • Sum{k=0..floor(n/2)} x^(n-k)*T(n-k,k) = A000007(n), A000045(n+1), A002605(n), A030195(n+1), A057087(n), A057088(n), A057089(n), A057090(n), A057091(n), A057092(n), A057093(n) for x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, respectively. Sum{k=0..floor(n/2)} (-1)^kx^(n-k)T(n-k,k) = A000007(n), A010892(n), A009545(n+1), A057083(n), A001787(n+1), A030191(n), A030192(n), A030240(n), A057084(n), A057085(n+1), A057086(n), A084329(n+1) for x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, respectively. - Philippe Deléham, Sep 16 2006
  • C(n,k) <= A062758(n) for n > 1. - Reinhard Zumkeller, Mar 04 2008
  • C(t+p-1, t) = Sum{i=0..t} C(i+p-2, i) = Sum{i=1..p} C(i+t-2, t-1). A binomial number is the sum of its left parent and all its right ancestors, which equals the sum of its right parent and all its left ancestors. - Lee Naish (lee(AT)cs.mu.oz.au), Mar 07 2008
  • From Paul D. Hanna, Mar 24 2011:
    • Let A(x) = Sum_{n>=0} x^(n(n+1)/2)*(1+x)^n be the g.f. of the flattened triangle:
    • A(x) = 1 + (x + x^2) + (x^3 + 2x^4 + x^5) + (x^6 + 3x^7 + 3*x^8 + x^9) +...
    • then A(x) equals the series Sum{n>=0} (1+x)^nx^nProduct{k=1..n} (1-(1+x)x^(2k-1))/(1-(1+x)x^(2k));
    • also, A(x) equals the continued fraction 1/(1- x(1+x)/(1+ x(1-x)(1+x)/(1- x^3(1+x)/(1+ x^2(1-x^2)(1+x)/(1- x^5(1+x)/(1+ x^3(1-x^3)(1+x)/(1- x^7(1+x)/(1+ x^4(1-x^4)(1+x)/(1- ...))))))))).
    • These formulas are due to (1) a q-series identity and (2) a partial elliptic theta function expression.
  • Row n of the triangle is the result of applying the ConvOffs transform to the first n terms of the natural numbers (1, 2, 3, ..., n). See A001263 or A214281 for a definition of this transformation. - Gary W. Adamson, Jul 12 2012
  • From L. Edson Jeffery, Aug 02 2012:
    • Row n (n >= 0) of the triangle is given by the n-th antidiagonal of the infinite matrix P^n, where P = (p_{i,j}), i,j >= 0, is the production matrix
    • 0, 1,
    • 1, 0, 1,
    • 0, 1, 0, 1,
    • 0, 0, 1, 0, 1,
    • 0, 0, 0, 1, 0, 1,
    • 0, 0, 0, 0, 1, 0, 1,
    • 0, 0, 0, 0, 0, 1, 0, 1,
    • 0, 0, 0, 0, 0, 0, 1, 0, 1,
    • ...
  • Row n of the triangle is also given by the n+1 coefficients of the polynomial P_n(x) defined by the recurrence P_0(x) = 1, P_1(x) = x + 1, Pn(x) = x*P{n-1}(x) + P_{n-2}(x), n > 1. - L. Edson Jeffery, Aug 12 2013
  • For a closed-form formula for arbitrary left and right borders of Pascal-like triangles see A228196. - Boris Putievskiy, Aug 18 2013
  • For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 04 2013
  • (1+x)^n = Sum{k=0..n} (-1)^(n-k)binomial(n,k)Sum{i=0..k} k^(n-i)binomial(k,i)x^(n-i)/(n-i)!. - Vladimir Kruchinin, Oct 21 2013
  • E.g.f.: A(x,y) = exp(x+xy) = 1 + (x+yx)/( E(0)-(x+yx)), where E(k) = 1 + (x+yx)/(1 + (k+1)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 08 2013
  • E.g.f.: E(0) -1, where E(k) = 2 + x(1+y)/(2k+1 - x*(1+y)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Dec 24 2013
  • G.f.: 1 + x(1+x)(1+x^2(1+x)/(W(0)-x^2-x^3)), where W(k) = 1 + (1+x)x^(k+2)
    • (1+x)*x^(k+3)/W(k+1); (continued fraction). - Sergei N. Gladkovskii, Dec 24 2013
  • Sum{n>=0} C(n,k)/n! = e/k!, where e = exp(1), while allowing n < k where C(n,k) = 0. Also Sum{n>=0} C(n+k-1,k)/n! = e A000262(k)/k!, and for k>=1 equals e A067764(k)/A067653(k). - Richard R. Forberg, Jan 01 2014
  • Sum_{n>=k} 1/C(n,k) = k/(k-1) for k>=1. - Richard R. Forberg, Feb 10 2014
  • From Tom Copeland, Apr 17 and 26 2014:
    • Multiply each n-th diagonal of the Pascal lower triangular matrix by x^n and designate the result by A007318(x) = P(x). Then with :xD:^n = x^n*(d/dx)^n and B(n,x), the Bell polynomials (A008277),
    • A) P(x)= exp(xdP) = exp[x(e^M-I)] = exp[M*B(.,x)] = (I+dP)^B(.,x)
    • with dP = A132440, M = A238385-I, and I = identity matrix, and
    • B) P(:xD:) = exp(dP:xD:) = exp[(e^M-I):xD:] = exp[MB(.,:xD:)] = exp[MxD] = (I+dP)^(xD) with action P(:xD:)g(x) = exp(dP:xD:)g(x) = g[(I+dP)*x] (cf. also A238363).
    • C) P(x)^y = P(yx). P(2x) = A038207(x) = exp[MB(.,2x)], the face vectors of the n-dim hypercubes.
    • D) P(x) = [St2]exp(xM)[St1] = [St2](I+dP)^x*[St1]
    • E) = [St1]^(-1)(I+dP)^x[St1] = [St2](I+dP)^x[St2]^(-1)
    • where [St1]=padded A008275 just as [St2]=A048993=padded A008277 and exp(x*M) = (I+dP)^x = sum(k=0,..,infinity, C(x,k) dP^k).
  • From Peter Bala, Dec 21 2014:
    • Recurrence equation: T(n,k) = T(n-1,k)*(n + k)/(n - k) - T(n-1,k-1) for n

      = 2 and 1 <= k < n, with boundary conditions T(n,0) = T(n,n) = 1. Note, changing the minus sign in the recurrence to a plus sign gives a recurrence for the square of the binomial coefficients - see A008459.

    • There is a relation between the e.g.f.'s of the rows and the diagonals of the triangle, namely, exp(x) e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)(1 + 3x + 3x^2/2! + x^3/3!) = 1 + 4x + 10x^2/2! + 20x^3/3! + 35x^4/4! + .... This property holds more generally for the Riordan arrays of the form ( f(x), x/(1 - x) ), where f(x) is an o.g.f. of the form 1 + f_1x + f_2x^2 + .... See, for example, A055248 and A106516.
    • Let P denote the present triangle. For k = 0,1,2,... define P(k) to be the lower unit triangular block array
    • /I_k 0\
    • \ 0 P/ having the k X k identity matrix I_k as the upper left block; in particular, P(0) = P. The infinite product P(0)P(1)P(2)..., which is clearly well-defined, is equal to the triangle of Stirling numbers of the second kind A008277. The infinite product in the reverse order, that is, ...P(2)P(1)P(0), is equal to the triangle of Stirling cycle numbers A130534.
  • C(a+b,c) = Sum{k=0..a} C(a,k)*C(b,b-c+k). This is a generalization of equation 1 from section 4.2.5 of the Prudnikov et al. reference, for a=b=c=n: C(2n,n) = Sum{k=0..n} C(n,k)^2. See Links section for animation of new formula. - Hermann Stamm-Wilbrandt, Aug 26 2015
  • The row polynomials of the Pascal matrix P(n,x) = (1+x)^n are related to the Bernoulli polynomials Br(n,x) and their umbral compositional inverses Bv(n,x) by the umbral relation P(n,x) = (-Br(.,-Bv(.,x)))^n = (-1)^n Br(n,-Bv(.,x)), which translates into the matrix relation P = M Br M * Bv, where P is the Pascal matrix, M is the diagonal matrix diag(1,-1,1,-1,...), Br is the matrix for the coefficients of the Bernoulli polynomials, and Bv that for the umbral inverse polynomials defined umbrally by Br(n,Bv(.,x)) = x^n = Bv(n,Br(.,x)). Note M = M^(-1). - Tom Copeland, Sep 05 2015
  • 1/(1-x)^k = (r(x) r(x^2) r(x^4) * ...) where r(x) = (1+x)^k. - Gary W. Adamson, Oct 17 2016

Cross references:


A047999: Sierpiński's [Sierpinski's] triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle mod 2.

by N. J. A. Sloane

Keywords: nonn,tabl,easy,nice

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 1 & 1 & & & & & & & & \\2 & 1 & 0 & 1 & & & & & & & \\3 & 1 & 1 & 1 & 1 & & & & & & \\4 & 1 & 0 & 0 & 0 & 1 & & & & & \\5 & 1 & 1 & 0 & 0 & 1 & 1 & & & & \\6 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & & & \\7 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & & \\8 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & \\9 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \end{array} $$

Comments:

  • Restored the alternative spelling of Sierpinski to facilitate searching for this triangle using regular-expression matching commands in ASCII. - N. J. A. Sloane, Jan 18 2016
  • Also triangle giving successive states of cellular automaton generated by "Rule 60" and "Rule 102". - Hans Havermann, May 26 2002
  • Also triangle formed by reading triangle of Eulerian numbers (A008292) mod 2.
    • Philippe Deléham, Oct 02 2003
  • Self-inverse when regarded as an infinite lower triangular matrix over GF(2).
  • Start with [1], repeatedly apply the map 0 -> [00/00], 1 -> [10/11] [Allouche and Berthe]

Formulae:

  • Lucas's Theorem is that T(n,k) = 1 if and only if the 1's in the binary expansion of k are a subset of the 1's in the binary expansion of n; or equivalently, k AND NOT n is zero, where AND and NOT are bitwise operators. - Chai Wah Wu, Feb 09 2016 and N. J. A. Sloane, Feb 10 2016
  • Sum_{k>=0} T(n, k) = A001316(n) = 2^A000120(n).
  • T(n,k) = T(n-1,k-1) XOR T(n-1,k), 0<k<n; T(n,0) = T(n,n) = 1. - Reinhard Zumkeller, Dec 13 2009
  • T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod 2 = |T(n-1,k-1) - T(n-1,k)|, 0<k<n; T(n,0) = T(n,n) = 1. - Rick L. Shepherd, Feb 23 2018
  • From Vladimir Shevelev, Dec 31 2013:
    • For polynomial {s_n(x)} we have
    • s_0(x)=1; for n>=1, s_n(x) = prod{i=1,...,A000120(n)}(x^(2^k_i) + 1),
    • if the binary expansion of n is n = sum{i=1,...,A000120(n)}2^k_i;
    • G.f. sum {n>=0} s_n(x)*z^n = prod{k>=0}(1 + (x^(2^k)+1)z^(2^k)) (0<z<1/x).
    • Let x>1, t>0 be real numbers. Then
    • sum{n>=0}1/s_n(x)^t = prod{k>=0}(1 + 1/(x^(2^k)+1)^t);
    • sum{n>=0}(-1)^A000120(n)/s_n(x)^t = prod{k>=0}(1 - 1/(x^(2^k)+1)^t).
    • In particular, for t=1, x>1, we have
    • sum{n>=0}(-1)^A000120(n)/s_n(x) = 1 - 1/x.

Cross references:


A029635: The (1,2)-Pascal triangle (or Lucas triangle) read by rows.

by Mohammad K. Azarian

Keywords: nonn,tabl,nice,easy

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 2 & & & & & & & & & \\1 & 1 & 2 & & & & & & & & \\2 & 1 & 3 & 2 & & & & & & & \\3 & 1 & 4 & 5 & 2 & & & & & & \\4 & 1 & 5 & 9 & 7 & 2 & & & & & \\5 & 1 & 6 & 14 & 16 & 9 & 2 & & & & \\6 & 1 & 7 & 20 & 30 & 25 & 11 & 2 & & & \\7 & 1 & 8 & 27 & 50 & 55 & 36 & 13 & 2 & & \\8 & 1 & 9 & 35 & 77 & 105 & 91 & 49 & 15 & 2 & \\9 & 1 & 10 & 44 & 112 & 182 & 196 & 140 & 64 & 17 & 2 \end{array} $$

Comments:

  • This is also called Vieta's array. - N. J. A. Sloane, Nov 22 2017
  • Dropping the first term and changing the boundary conditions to T(n,1)=n, T(n,n-1)=2 (n>=2), T(n,n)=1 yields the number of nonterminal symbols (which generate strings of length k) in a certain context-free grammar in Chomsky normal form that generates all permutations of n symbols. Summation over k (1<=k<=n) results in A003945. For the number of productions of this grammar: see A090327. Example: 1; 2, 1; 3, 2, 1; 4, 5, 2, 1; 5, 9, 7, 2, 1; 6, 14, 16, 9, 2, 1; In addition to the example of A090327 we have T(3,3)=#{S}=1, T(3,2)=#{D,E}=2 and T(3,1)=#{A,B,C}=3. - Peter R. J. Asveld, Jan 29 2004
  • With T(0,0)=1 : Triangle T(n,k), read by rows, given by (1,0,0,0,0,0,0,0,) DELTA (2,-1,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938.
    • Philippe Deléham, Oct 10 2011
  • For n > 0: T(n,k) = A097207(n-1,k), 0 <= k < n. - Reinhard Zumkeller, Mar 12 2012
  • Much as the original Pascal triangle gives the Fibonacci numbers as sums of its diagonals, this triangle gives the Lucas numbers (A000032) as sums of its diagonals; see Posamentier & Lehmann (2007). - Alonso del Arte, Apr 09 2012

Formulae:

  • T(n,k) = T(n-1, k-1) + T(n-1, k) = C(n, k) + C(n-1, k-1) = C(n, k)*(n+k)/n = A007318(n, k) + A007318(n-1, k-1) = A061896(n+k, k) but with T(0, 0)=1 and T(1, 1)=2. Row sum is floor[3^2(n-1)] i.e., A003945. - Henry Bottomley, Apr 26 2002
  • G.f.: 1 + (1 + xy) / (1 - x - xy). - Michael Somos, Jul 15 2003
  • G.f. for n-th row: (x+2y)(x+y)^(n-1).
  • O.g.f. for row n: (1+x)/(1-x)^(n+1). The entries in row n are the nonzero entries in column n of A053120 divided by 2^(n-1). - Peter Bala, Aug 14 2008
  • T(2n,n) - T(2n,n+1)= Catalan(n)= A000108(n). - Philippe Deléham, Mar 19 2009
  • With T(0,0) = 1, as in the Example section below, this is known as Vieta's array. The LU factorization of the square array is given by Yang and Leida, equation 20. - Peter Bala, Feb 11 2012
  • exp(x) e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)(1 + 4x + 5x^2/2! + 2x^3/3!) = 1 + 5x + 14x^2/2! + 30x^3/3!
    • 55*x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ). - Peter Bala, Dec 22 2014
  • For n>=1: T(n,0) + T(n,1) + T(n,2) = A000217(n+1). T(n,n-2) = (n-1)^2. - Bob Selcoe, Mar 29 2016:

Cross references:


A008459: Square the entries of Pascal's triangle.

by N. J. A. Sloane

Keywords: nonn,tabl,easy

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 1 & 1 & & & & & & & & \\2 & 1 & 4 & 1 & & & & & & & \\3 & 1 & 9 & 9 & 1 & & & & & & \\4 & 1 & 16 & 36 & 16 & 1 & & & & & \\5 & 1 & 25 & 100 & 100 & 25 & 1 & & & & \\6 & 1 & 36 & 225 & 400 & 225 & 36 & 1 & & & \\7 & 1 & 49 & 441 & 1225 & 1225 & 441 & 49 & 1 & & \\8 & 1 & 64 & 784 & 3136 & 4900 & 3136 & 784 & 64 & 1 & \\9 & 1 & 81 & 1296 & 7056 & 15876 & 15876 & 7056 & 1296 & 81 & 1 \end{array} $$

Comments:

  • Number of lattice paths from (0, 0) to (n, n) with steps (1, 0) and (0, 1), having k right turns. - Emeric Deutsch, Nov 23 2003
  • Product of A007318 and A105868. - Paul Barry, Nov 15 2005
  • Number of partitions that fit in an n X n box with Durfee square k. - Franklin T. Adams-Watters, Feb 20 2006
  • From Peter Bala, Oct 23 2008:
    • Narayana numbers of type B. Row n of this triangle is the h-vector of the simplicial complex dual to an associahedron of type B_n (a cyclohedron) [Fomin & Reading, p. 60]. See A063007 for the corresponding f-vectors for associahedra of type B_n. See A001263 for the h-vectors for associahedra of type A_n. The Hilbert transform of this triangular array is A108625 (see A145905 for the definition of this term).
    • Let A_n be the root lattice generated as a monoid by {e_i - e_j: 0 <= i, j <= n + 1}. Let P(A_n) be the polytope formed by the convex hull of this generating set. Then the rows of this array are the h-vectors of a unimodular triangulation of P(A_n) [Ardila et al.]. A063007 is the corresponding array of f-vectors for these type A_n polytopes. See A086645 for the array of h-vectors for type C_n polytopes and A108558 for the array of h-vectors associated with type D_n polytopes.

Formulae:

  • E.g.f.: exp((1+y)x)BesselI(0, 2sqrt(y)x). - Vladeta Jovovic, Nov 17 2003
  • G.f.: 1/sqrt(1-2x-2xy+x^2-2x^2y+x^2y^2); g.f. for row n: (1-t)^n P_n[(1+t)/(1-t)] where the P_n's are the Legendre polynomials. - Emeric Deutsch, Nov 23 2003 [The original version of the bivariate g.f. has been modified with the roles of x and y interchanged so that now x corresponds to n and y to k. - Petros Hadjicostas, Oct 22 2017]
  • G.f. for column k is sum(C(k, j)^2*x^(k+j), j, 0, k)/(1-x)^(2k+1). - Paul Barry, Nov 15 2005
  • Column k has g.f. x^kLegendre_P(k, (1+x)/(1-x))/(1-x)^(k+1) = x^ksum{j = 0..k, C(k, j)^2*x^j}/(1-x)^(2k+1). - Paul Barry, Nov 19 2005
  • Let E be the operator DxD, where D denotes the derivative operator d/dx. Then 1/n!^2 E^n(1/(1-x)) = (row n generating polynomial)/(1-x)^(2n+1) = sum_{k = 0..inf} binomial(n + k, k)^2x^k. For example, when n = 3 we have 1/3!^2E^3(1/(1-x)) = (1 + 9x + 9x^2 + x^3)/(1-x)^7 = 1/3!^2 sum_{k = 0..inf} [(k+1)(k+2)(k+3)]^2*x^k. - Peter Bala, Oct 23 2008
  • G.f.: A(x, y) = Sum_{n >= 0} (2n)!/n!^2 x^(2n)y^n/(1-x-x*y)^(2n+1). - Paul D. Hanna, Oct 31 2010
  • From Peter Bala, Jul 24 2013:
    • Let E(y) = sum_{n >= 0} y^n/n!^2 = BesselJ(0, 2sqrt(-y)). Generating function: E(y)E(xy) = 1 + (1 + x)y + (1 + 4x + x^2)y^2/2!^2 + (1 + 9x + 9x^2 + x^3)y^3/3!^2 + .... Cf. the unsigned version of A021009 with generating function exp(y)E(x*y).
    • The n-th power of this array has the generating function E(y)^nE(xy). In particular, the matrix inverse A055133 has the generating function E(x*y)/E(y).
  • T(n,k) = T(n-1,k)*(n+k)/(n-k)+T(n-1,k-1), T(n,0)=T(n,n)=1. - Vladimir Kruchinin, Oct 18 2014
  • Observe that the recurrence T(n,k) = T(n-1,k)*(n+k)/(n-k) - T(n-1,k-1), for n

    = 2 and 1 <= k < n, with boundary conditions T(n,0) = T(n,n) = 1 gives Pascal's triangle A007318. - Peter Bala, Dec 21 2014

  • n-th row polynomial R(n,x) = [z^n] (1 + (1 + x)z + xz^2)^n. Note that 1/n[z^(n-1)] (1 + (1 + x)z + x*z^2)^n gives the row polynomials of A001263.
    • Peter Bala, Jun 24 2015
  • Binomial transform of A105868. If G(x,t) = 1/sqrt(1 - 2(1 + t)x + (1 - t)^2x^2) denotes the o.g.f. of this array then 1 + xd/dx(log(G(x,t)) = 1 + (1 + t)x + (1 + 6t + t^2)*x^2 + ... is the o.g.f. for A086645. - Peter Bala, Sep 06 2015
  • T(n,k) = Sum_{i=0..n} C(n-i,k)C(n,i)C(n+i,i)*(-1)^(n-i-k). - Vladimir Kruchinin, Jan 14 2018
  • T(n,k) = A007318(n,k)^2. - Sean A. Irvine, Mar 29 2018

Cross references:


A029653: Numbers in (2,1)-Pascal triangle (by row).

by Mohammad K. Azarian

Keywords: nonn,tabl

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 2 & 1 & & & & & & & & \\2 & 2 & 3 & 1 & & & & & & & \\3 & 2 & 5 & 4 & 1 & & & & & & \\4 & 2 & 7 & 9 & 5 & 1 & & & & & \\5 & 2 & 9 & 16 & 14 & 6 & 1 & & & & \\6 & 2 & 11 & 25 & 30 & 20 & 7 & 1 & & & \\7 & 2 & 13 & 36 & 55 & 50 & 27 & 8 & 1 & & \\8 & 2 & 15 & 49 & 91 & 105 & 77 & 35 & 9 & 1 & \\9 & 2 & 17 & 64 & 140 & 196 & 182 & 112 & 44 & 10 & 1 \end{array} $$

Comments:

  • Reverse of A029635. Row sums are A003945. Diagonal sums are Fib(n+2) = sum_{k=0..floor(n/2)} (2n-3k)C(n-k,n-2k)/(n-k). - Paul Barry, Jan 30 2005
  • Riordan array ((1+x)/(1-x), x/(1-x)). The signed triangle (-1)^(n-k)T(n,k) or ((1-x)/(1+x), x/(1+x)) is the inverse of A055248. Row sums are A003945. Diagonal sums are F(n+2). - Paul Barry, Feb 03 2005
  • Row sums = A003945: (1, 3, 6, 12, 24, 48, 96...) = (1, 3, 7, 15, 31, 63, 127...) - (0, 0, 1, 3, 7, 15, 31,...); where (1, 3, 7, 15,...) = A000225. - Gary W. Adamson, Apr 22 2007
  • Triangle T(n,k), read by rows, given by (2,-1,0,0,0,0,0,0,0,...) DELTA (1,0,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938. - Philippe Deléham, Nov 17 2011
  • A029653 is jointly generated with A208510 as an array of coefficients of polynomials v(n,x): initially, u(1,x)=v(1,x)=1; for n>1, u(n,x)=u(n-1,x)+xv(n-1)x and v(n,x)=u(n-1,x)+xv(n-1,x)+1. See the Mathematica section. - Clark Kimberling, Feb 28 2012

Formulae:

  • T(n, k) = C(n-2, k-1) + C(n-2, k) + C(n-1, k-1) + C(n-1, k) except for n=0.
  • G.f.: (1 + x + y + xy)/(1 - y - xy). - Ralf Stephan, May 17 2004
  • T(n, k) = (2n-k)*binomial(n, n-k)/n, n, k>0. - Paul Barry, Jan 30 2005
  • Sum_{k=0..n} T(n, k)*x^k gives A003945-A003954 for x = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. - Philippe Deléham, Jul 10 2005
  • T(n, k) = C(n-1, k) + C(n, k) . - Philippe Deléham, Jul 10 2005
  • Equals A097806 A007318, i.e., the pairwise operator Pascal's Triangle as infinite lower triangular matrices. - Gary W. Adamson, Apr 22 2007
  • From Peter Bala, Dec 27 2014:
    • exp(x) e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)(2 + 5x + 4x^2/2! + x^3/3!) = 2 + 7x + 16x^2/2! + 30x^3/3! + 50x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ).
    • Let M denote the lower unit triangular array with 1's on the main diagonal and 1's everywhere else below the main diagonal except for the first column which consists of the sequence [1,2,2,2,....]. For k = 0,1,2,... define M(k) to be the lower unit triangular block array
    • /I_k 0\
    • \ 0 M/ having the k X k identity matrix I_k as the upper left block; in particular, M(0) = M. Then the present triangle equals the infinite product M(0)M(1)M(2)*... (which is clearly well-defined). See the Example section.

Cross references:


A074909: Running sum of Pascal's triangle (A007318), or beheaded Pascal's triangle read by beheaded rows.

by Wouter Meeussen, Oct 01 2002

Keywords: easy,nonn,tabl

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 1 & 2 & & & & & & & & \\2 & 1 & 3 & 3 & & & & & & & \\3 & 1 & 4 & 6 & 4 & & & & & & \\4 & 1 & 5 & 10 & 10 & 5 & & & & & \\5 & 1 & 6 & 15 & 20 & 15 & 6 & & & & \\6 & 1 & 7 & 21 & 35 & 35 & 21 & 7 & & & \\7 & 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & & \\8 & 1 & 9 & 36 & 84 & 126 & 126 & 84 & 36 & 9 & \\9 & 1 & 10 & 45 & 120 & 210 & 252 & 210 & 120 & 45 & 10 \end{array} $$

Comments:

  • This sequence counts the "almost triangular" partitions of n. A partition is triangular if it is of the form 0+1+2+...+k. Examples: 3=0+1+2, 6=0+1+2+3. An "almost triangular" partition is a triangular partition with at most 1 added to each of the parts. Examples: 7 = 1+1+2+3 = 0+2+2+3 = 0+1+3+3 = 0+1+2+4. Thus a(7)=4. 8 = 1+2+2+3 = 1+1+3+3 = 1+1+2+4 = 0+2+3+3 = 0+2+2+4 = 0+1+3+4 so a(8)=6. - Moshe Shmuel Newman, Dec 19 2002
  • The "almost triangular" partitions are the ones cycled by the operation of "Bulgarian solitaire", as defined by Martin Gardner.
  • Start with A007318 - I (I = Identity matrix), then delete right border of zeros. - Gary W. Adamson, Jun 15 2007
  • Also the number of increasing acyclic functions from {1..n-k+1} to {1..n+2}. A function f is acyclic if for every subset B of the domain the image of B under f does not equal B. For example, T(3,1)=4 since there are exactly 4 increasing acyclic functions from {1,2,3} to {1,2,3,4,5}: f1={(1,2),(2,3),(3,4)}, f2={(1,2),(2,3),(3,5)}, f3={(1,2),(2,4),(3,5)} and f4={(1,3),(2,4),(4,5)}. - Dennis P. Walsh, Mar 14 2008
  • Second Bernoulli polynomials are (from A164555 instead of A027641) B2(n,x) = 1; 1/2, 1; 1/6, 1, 1; 0, 1/2, 3/2, 1; -1/30, 0, 1, 2, 1; 0, -1/6, 0, 5/3, 5/2, 1; ... . Then (B2(n,x)/A002260) = 1; 1/2, 1/2; 1/6, 1/2, 1/3; 0, 1/4, 1/2, 1/4; -1/30, 0, 1/3, 1/2, 1/5; 0, -1/12, 0, 5/12, 1/2, 1/6; ... . See (from Faulhaber 1631) Jacob Bernoulli Summae Potestatum (sum of powers) in A159688. Inverse polynomials are 1; -1, 2; 1, -3, 3; -1, 4, -6, 4; ... = A074909 with negative even diagonals. Reflected A053382/A053383 = reflected B(n,x) = RB(n,x) = 1; -1/2, 1; 1/6, -1, 1; 0, 1/2, -3/2, 1; ... . A074909 is inverse of RB(n,x)/A002260 = 1; -1/2, 1/2; 1/6, -1/2, 1/3; 0, 1/4, -1/2, 1/4; ... . - Paul Curtz, Jun 21 2010

Formulae:

  • T(n, k) = Sum_{i=0..n} C(i, n-k) = C(n+1, k).
  • Row n has g.f. (1+x)^(n+1)-x^(n+1).
  • E.g.f.: ((1+x)e^t - x) e^(xt). The row polynomials p_n(x) satisfy dpn(x)/dx = (n+1)*p(n-1)(x). - Tom Copeland, Jul 10 2018
  • T(n, k) = T(n-1, k-1) + T(n-1, k) for k: 0<k<n, T(n, 0)=1, T(n, n)=n. - Reinhard Zumkeller, Apr 18 2005
  • T(n,k) = T(n-1,k) + 2*T(n-1,k-1) - T(n-2,k-1) - T(n-2,k-2), T(0,0)=1, T(1,0)=1, T(1,1)=2, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Dec 27 2013
  • G.f. for column k (with leading zeros): x^(k-1)*(1/(1-x)^(k+1)-1), k >= 0. - Wolfdieter Lang, Nov 04 2014
  • Up(n, x+y) = (Up(.,x)+ y)^n = Sum_{k=0..n} binomial(n,k) Up(k,x)y^(n-k), where Up(n,x) = ((x+1)^(n+1)-x^(n+1)) / (n+1) = P(n,x)/(n+1) with P(n,x) the n-th row polynomial of this entry. dUp(n,x)/dx = n Up(n-1,x) and dP(n,x)/dx = (n+1)*P(n-1,x). - Tom Copeland, Nov 14 2014
  • The o.g.f. GF(x,t) = x / ((1-tx)(1-(1+t)x)) = x + (1+2t)x^2 + (1+3t+3t^2)x^3 + ... has the inverse GFinv(x,t) = (1+(1+2t)x-sqrt(1+(1+2t)*2x+x^2))/(2t(1+t)x) in x about 0, which generates the row polynomials (mod row signs) of A033282. The reciprocal of the o.g.f., i.e., x/GF(x,t), gives the free cumulants (1, -(1+2t) , t(1+t) , 0, 0, ...) associated with the moments defined by GFinv, and, in fact, these free cumulants generate these moments through the noncrossing partitions of A134264. The associated e.g.f. and relations to Grassmannians are described in A248727, whose polynomials are the basis for an Appell sequence of polynomials that are umbral compositional inverses of the Appell sequence formed from this entry's polynomials (distinct from the one described in the comments above, without the normalizing reciprocal). - Tom Copeland, Jan 07 2015

Cross references:


A037027: Skew Fibonacci-Pascal triangle read by rows.

by Floor van Lamoen, Jan 01 1999

Keywords: easy,nonn,tabl

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 1 & 1 & & & & & & & & \\2 & 2 & 2 & 1 & & & & & & & \\3 & 3 & 5 & 3 & 1 & & & & & & \\4 & 5 & 10 & 9 & 4 & 1 & & & & & \\5 & 8 & 20 & 22 & 14 & 5 & 1 & & & & \\6 & 13 & 38 & 51 & 40 & 20 & 6 & 1 & & & \\7 & 21 & 71 & 111 & 105 & 65 & 27 & 7 & 1 & & \\8 & 34 & 130 & 233 & 256 & 190 & 98 & 35 & 8 & 1 & \\9 & 55 & 235 & 474 & 594 & 511 & 315 & 140 & 44 & 9 & 1 \end{array} $$

Comments:

  • T(n,k) is the number of lattice paths from (0,0) to (n,k) using steps (0,1), (1,0), (2,0). - Joerg Arndt, Jun 30 2011
  • T(n,k) is the number of lattice paths of length n, starting from the origin and ending at (n,k), using horizontal steps H=(1,0), up steps U=(1,1) and down steps D=(1,-1), never containing UUU, DD, HD. For instance, for n=4 and k=2, we have the paths; HHUU, HUHU, HUUH, UHHU, UHUH, UUHH, UUDU, UDUU, UUUD. - Emanuele Munarini, Mar 15 2011
  • Row sums form Pell numbers A000129, T(n,0) forms Fibonacci numbers A000045, T(n,1) forms A001629. T(n+k,n-k) is polynomial sequence of degree k.
  • T(n,k) gives a convolved Fibonacci sequence (A001629, A001872, etc.).
  • As a Riordan array, this is (1/(1-x-x^2),x/(1-x-x^2)). An interesting factorization is (1/(1-x^2),x/(1-x^2))*(1/(1-x),x/(1-x)) [abs(A049310) times A007318]. Diagonal sums are the Jacobsthal numbers A001045(n+1). - Paul Barry, Jul 28 2005

Formulae:

  • T(n, m) = T'(n-1, m)+T'(n-2, m)+T'(n-1, m-1), where T'(n, m) = T(n, m) for n

    = 0 and 0< = m< = n and T'(n, m) = 0 otherwise.

  • G.f.: 1/(1 - y - y*z - y^2).
  • G.f. for k-th column: x/(1-x-x^2)^k.
  • T(n, m) = sum(binomial(m+k, m)*binomial(k, n-k-m), k=0..n-m), n>=m>=0, else 0.
    • Wolfdieter Lang, Jun 17 2002
  • T(n, m) = ((n-m+1)T(n, m-1) + 2(n+m)T(n-1, m-1))/(5m), n >= m >= 1; T(n, 0)= A000045(n+1); T(n, m)= 0 if n<m. - Wolfdieter Lang, Apr 12 2000
  • Chebyshev coefficient triangle (abs(A049310)) times Pascal's triangle (A007318) as product of lower triangular matrices. T(n, k)=sum{k=0..n, C((n+j)/2, j)(1+(-1)^(n+j))C(j, k)/2}. - Paul Barry, Dec 22 2004
  • Let R(n) = n-th row polynomial in x, with R(0)=1, then R(n+1)/R(n) equals the continued fraction [1+x;1+x, ...(1+x) occurring (n+1) times..., 1+x] for n>=0.
    • Paul D. Hanna, Feb 27 2004
  • T(n,k) = sum{j=0..n, C(n-j,j)C(n-2j,k)}; in Egorychev notation, T(n,k)=res_w(1-w-w^2)^(-k-1)*w^(-n+k+1). - Paul Barry, Sep 13 2006
  • Sum_{k=0..n} T(n,k)*x^k = A000045(n+1), A000129(n+1), A006190(n+1), A001076(n+1), A052918(n), A005668(n+1), A054413(n), A041025(n), A099371(n+1), A041041(n), A049666(n+1), A041061(n), A140455(n+1), A041085(n), A154597(n+1), A041113(n) for n = 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 respectively. - Philippe Deléham, Nov 29 2009
  • T((m+1)n+r-1,mn+r-1)r/(mn+r) = Sum_{k=1..n} k/nT((m+1)n-k-1,mn-1)(r+k,r), n>=m>1.
  • T(n-1,m-1) = m/nsum(k=1..n-m+1,kA000045(k)*T(n-k-1,m-2),k,1,n-m+1), n>=m>1.
    • Vladimir Kruchinin, Mar 17 2011
  • T(n,k) = binomial(n,k)*hypergeom([(k-n)/2, (k-n+1)/2], [-n], -4) for n>=1. - Peter Luschny, Apr 25 2016

Cross references:


A130595: Triangle read by rows: lower triangular matrix which is inverse to Pascal's triangle (A007318) regarded as a lower triangular matrix.

by Philippe Deléham, Jun 17 2007

Keywords: sign,nice,tabl

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & -1 & 1 & & & & & & & & \\2 & 1 & -2 & 1 & & & & & & & \\3 & -1 & 3 & -3 & 1 & & & & & & \\4 & 1 & -4 & 6 & -4 & 1 & & & & & \\5 & -1 & 5 & -10 & 10 & -5 & 1 & & & & \\6 & 1 & -6 & 15 & -20 & 15 & -6 & 1 & & & \\7 & -1 & 7 & -21 & 35 & -35 & 21 & -7 & 1 & & \\8 & 1 & -8 & 28 & -56 & 70 & -56 & 28 & -8 & 1 & \\9 & -1 & 9 & -36 & 84 & -126 & 126 & -84 & 36 & -9 & 1 \end{array} $$

Comments:

  • Triangle T(n,k), read by rows, given by [-1,0,0,0,0,0,0,0,...] DELTA [1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938.
  • Coefficients of the polynomials generated by the e.g.f. exp(xt)exp(-t). - Peter Luschny, Jul 13 2009
  • Riordan array (1/(1+x), x/(1+x)). - Philippe Deléham, Nov 29 2009
  • Multiplication of a sequence (written as column vector) by this matrix (to the left) yields the inverse Binomial transform of the sequence. - M. F. Hasler, Nov 01 2014
  • From Tom Copeland, Nov 16 2016:

Formulae:

  • T(n,k) = (-1)^(n-k)binomial(n,k) = (-1)^(n-k)A007318(n,k).
  • T(n,k) = T(n-1,k-1)-T(n-1,k). - Philippe Deléham, Oct 10 2011
  • G.f.: 1/(1+x-x*y). - R. J. Mathar, Aug 11 2015 [corrected by Anders Claesson, Nov 28 2015]
  • Conjecture from Dale Gerdemann, Nov 28 2015: T(n,k) = (n-k+1)T(n-1,k-1) + (k-1)T(n-1,k). Proof from Anders Claesson, Nov 29 2015: It follows from T(n,k) = T(n-1,k-1) - T(n-1,k) and nT(n-1,k-1) = kT(n,k) that (n-k+1)T(n-1,k-1) + (k-1)T(n-1,k) = nT(n-1,k-1) - (k-1)T(n-1,k-1) + (k-1)T(n-1,k) = nT(n-1,k-1) - (k-1)(T(n-1,k-1) - T(n-1,k)) = nT(n-1,k-1) - (k-1)T(n,k) = nT(n-1,k-1) - k*T(n,k) + T(n,k) = T(n,k). QED
  • (-1)^(n+1) Sum{k=1..n} T(n,k)/k = Sum{k=1..n} 1/k = H(n) where H(n) is the n-th harmonic number. For a proof see link "Relation between binomial coefficients and harmonic numbers". - Wolfgang Hintze, Oct 22 2016

Cross references:


A132440: Infinitesimal Pascal matrix: generator (lower triangular matrix representation) of the Pascal matrix, the classical operator xDx, iterated Laguerre transforms, associated matrices of the list partition transform and general Euler transformation for sequences.

by Tom Copeland, Nov 13 2007, Nov 15 2007, Nov 22 2007, Dec 02 2007

Keywords: easy,nonn,tabl

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 0 & & & & & & & & & \\1 & 1 & 0 & & & & & & & & \\2 & 0 & 2 & 0 & & & & & & & \\3 & 0 & 0 & 3 & 0 & & & & & & \\4 & 0 & 0 & 0 & 4 & 0 & & & & & \\5 & 0 & 0 & 0 & 0 & 5 & 0 & & & & \\6 & 0 & 0 & 0 & 0 & 0 & 6 & 0 & & & \\7 & 0 & 0 & 0 & 0 & 0 & 0 & 7 & 0 & & \\8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 8 & 0 & \\9 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 9 & 0 \end{array} $$

Comments:

  • Let M(t) = exp(tT) = Lim_{n->infinity} (1 + tT/n)^n.
  • Pascal matrix = [ binomial(n,k) ] = M(1) = exp(T), truncating the series gives the n X n submatrices.
  • Inverse Pascal matrix = M(-1) = exp(-T) = matrix for inverse binomial transform.
  • A(j) = T^j / j! equals the matrix [bin(n,k) * delta(n-k-j)] where delta(n) = 1 if n=0 and vanishes otherwise (Kronecker delta); i.e., A(j) is a matrix with all the terms 0 except for the j-th lower (or main for j=0) diagonal which equals that of the Pascal triangle. Hence the A(j)'s form a linearly independent basis for all matrices of the form [binomial(n,k) d(n-k)] which include as a subset the invertible associated matrices of the list partition transform (LPT) of A133314.
  • For sequences with b(0) = 1, umbrally,

Formulae:

  • T = log(P) with the Pascal matrix P:=A007318. This should be read as T_N = log(P_N) with P_N the N X N matrix P, N>=2. Because P_N is lower triangular with all diagonal elements 1, the series log(1_N-(1_N-P_N)) stops after N-1 terms because (1_N-P_N)^N is the 0_N-matrix. - Wolfdieter Lang, Oct 14 2010
  • Given a polynomial sequence p_n(x) with p_0(x)=1 and the lowering and raising operators L and R defined by L pn(x) = n * p(n-1)(x) and R pn(x) = p(n+1)(x), the matrix T represents the action of RLR in the p_n(x) basis. For p_n(x) = x^n, L = D = d/dx and R = x. For p_n(x) = x^n/n!, L = DxD and R = D^(-1). - Tom Copeland, Oct 25 2012
  • From Tom Copeland, Apr 26 2014:
    • A) T = exp(A238385-I) - I
    • B) = [St1]P[St2] - I
    • C) = [St1]P[St1]^(-1) - I
    • D) = [St2]^(-1)P[St2] - I
    • E) = [St2]^(-1)P[St1]^(-1) - I
    • where P=A007318, [St1]=padded A008275 just as [St2]=A048993=padded A008277, and I=identity matrix.
  • From Robert Israel, Oct 02 2015:
    • G.f. Sum_{k >= 1} k x^((k+3/2)^2/2 - 17/8) is related to Jacobi theta functions.
    • If 8*n+17 = y^2 is a square, then a(n) = (y-3)/2, otherwise a(n) = 0.


A135278: Triangle read by rows, giving the numbers T(n,m) = binomial(n+1, m+1); or, Pascal's triangle A007318 with its left-hand edge removed.

by Zerinvary Lajos, Dec 02 2007

Keywords: easy,nonn,tabl

Data:

$$ \begin{array}{c|ccccccccccc } n, k & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline 0 & 1 & & & & & & & & & \\1 & 2 & 1 & & & & & & & & \\2 & 3 & 3 & 1 & & & & & & & \\3 & 4 & 6 & 4 & 1 & & & & & & \\4 & 5 & 10 & 10 & 5 & 1 & & & & & \\5 & 6 & 15 & 20 & 15 & 6 & 1 & & & & \\6 & 7 & 21 & 35 & 35 & 21 & 7 & 1 & & & \\7 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 & & \\8 & 9 & 36 & 84 & 126 & 126 & 84 & 36 & 9 & 1 & \\9 & 10 & 45 & 120 & 210 & 252 & 210 & 120 & 45 & 10 & 1 \end{array} $$

Comments:

  • T(n,m) is the number of m-faces of a regular n-simplex.
  • An n-simplex is the n-dimensional analog of a triangle. Specifically, a simplex is the convex hull of a set of (n + 1) affinely independent points in some Euclidean space of dimension n or higher, i.e., a set of points such that no m-plane contains more than (m + 1) of them. Such points are said to be in general position.
  • Reversing the rows gives A074909, which as a linear sequence is essentially the same as this.
  • From Tom Copeland, Dec 07 2007:
    • T(n,k) * (k+1)! = A068424. The comment on permuted words in A068424 shows that T is related to combinations of letters defined by connectivity of regular polytope simplexes.
    • If T is the diagonally-shifted Pascal matrix, binomial(n+m, k+m), for m=1, then T is a fundamental type of matrix that is discussed in A133314 and the following hold.
    • The infinitesimal matrix generator is given by A132681, so T = LM(1) of A132681 with inverse LM(-1).
    • With a(k) = (-x)^k / k!, T * a = [ Laguerre(n,x,1) ], a vector array with index n for the Laguerre polynomials of order 1. Other formulas for the action of T are given in A132681.
    • T(n,k) = (1/n!) (D_x)^n (D_t)^k Gf(x,t) evaluated at x=t=0 with Gf(x,t) = exp[ t * x/(1-x) ] / (1-x)^2.
    • [O.g.f. for T ] = 1 / { [ 1 - t x/(1-x) ] (1-x)^2 }. [ O.g.f. for row sums ] = 1 / { (1-x) * (1-2x) }, giving A000225 (without a leading zero) for the row sums. Alternating sign row sums are all 1. [Sign correction noted by Vincent J. Matsko, Jul 19 2015]
    • O.g.f. for row polynomials = [ (1+q)**(n+1) - 1 ] / [ (1+q) -1 ] = A(1,n+1,q) on page 15 of reference on Grassmann cells in A008292.

Formulae:

  • T(n, k) = Sum_{j=k..n} binomial(j,k) = binomial(n+1, k+1), n >= k >= 0, else
    1. (Partial sum of column k of A007318 (Pascal), or summation on the upper binomial index (Graham et al. (GKP), eq. (5.10). For the GKP reference see A007318.) - Wolfdieter Lang, Aug 22 2012
  • E.g.f.: 1/x((1 + x)exp(t(1 + x)) - exp(t)) = 1 + (2 + x)t + (3 + 3x + x^2)t^2/2! + .... The infinitesimal generator for this triangle has the sequence [2,3,4,...] on the main subdiagonal and 0's elsewhere. - Peter Bala, Jul 16 2013
  • T(n,k) = 2*T(n-1,k) + T(n-1,k-1) - T(n-2,k) - T(n-2,k-1), T(0,0)=1, T(1,0)=2, T(1,1)=1, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Dec 27 2013
  • T(n,k) = A193862(n,k)/2^k. - Philippe Deléham, Jan 29 2014
  • G.f.: 1/((1-x)(1-x-xy)). - Philippe Deléham, Mar 13 2014
  • From Tom Copeland, Mar 26 2014:
    • [From Copeland's 2007 and 2008 comments]
    • A) O.g.f.: 1 / { [ 1 - t x/(1-x) ] (1-x)^2 } (same as Deleham's).
    • B) The infinitesimal generator for T is given in A132681 with m=1 (same as Bala's), which makes connections to the ubiquitous associated Laguerre polynomials of integer orders, for this case the Laguerre polynomials of order one L(n,-t,1).
    • C) O.g.f. of row e.g.f.s: Sum_{n>=0} L(n,-t,1) x^n = exp[tx/(1-x)]/(1-x)^2 = 1 + (2+t)x + (3+3t+t^2/2!)x^2 + (4+6t+4t^2/2!+t^3/3!)x^3+ ... .
    • D) E.g.f. of row o.g.f.s: ((1+t)exp((1+t)x)-exp(x))/t (same as Bala's).
    • E) E.g.f. for T(n,k)*a(n-k): {(a+t) exp[(a+t)x] - a exp(a x)}/t, umbrally. For example, for a(k)=2^k, the e.g.f. for the row o.g.f.s is {(2+t) exp[(2+t)x] - 2 exp(2x)}/t.
  • From Tom Copeland, Apr 28 2014:
    • With different indexing
    • A) O.g.f. by row: [(1+t)^n-1]/t.
    • B) O.g.f. of row o.g.f.s: {1/[1-(1+t)*x] - 1/(1-x)}/t.
    • C) E.g.f. of row o.g.f.s: {exp[(1+t)*x]-exp(x)}/t.
    • These generating functions are related to row e.g.f.s of A111492.
  • From Tom Copeland, Sep 17 2014:
  • A) U(x,s,t)= x^2/[(1-tx)(1-(s+t)x)] = Sum_{n >= 0} F(n,s,t)x^(n+2) is a generating function for bivariate row polynomials of T, e.g., F(2,s,t)= s^2 + 3st + 3t^2 (Buchstaber, 2008).
  • B) dU/dt=x^2 dU/dx with U(x,s,0)= x^2/(1-s*x) (Buchstaber, 2008).
  • C) U(x,s,t) = exp(tx^2d/dx)U(x,s,0) = U(x/(1-t*x),s,0).
  • D) U(x,s,t) = Sum[n >= 0, (tx)^n L(n,-:xD:,-1)] U(x,s,0), where (:xD:)^k=x^k(d/dx)^k and L(n,x,-1) are the Laguerre polynomials of order -1, related to normalized Lah numbers. (End)
  • E.g.f. satisfies the differential equation d/dt(e.g.f.(x,t)) = (x+1)*e.g.f.(x,t) + exp(t). - Vincent J. Matsko, Jul 18 2015
  • The e.g.f. of the Norlund generalized Bernoulli (Appell) polynomials of order m, NB(n,x;m), is given by exponentiation of the e.g.f. of the Bernoulli numbers, i.e., multiple binomial self-convolutions of the Bernoulli numbers, through the e.g.f. exp[NB(.,x;m)t] = (t/(e^t - 1))^(m+1) * e^(xt). Norlund gave the relation to the factorials (x-1)!/(x-1-n)! = (x-1) ... (x-n) = NB(n,x;n), so T(n,m) = NB(m+1,n+2;m+1)/(m+1)!. - Tom Copeland, Oct 01 2015

Cross references:

Sandbox


In [60]:
from requests import get
from IPython.display import Markdown

In [61]:
code=45

payload = {"fmt": "json", 
           #"q": "id:A{:06d}".format(code)}
           "q": "fibonacci",
           "start": 0}

doc_result = get("https://oeis.org/search", params=payload,)
doc = doc_result.json()

In [62]:
doc_result.url


Out[62]:
'https://oeis.org/search?fmt=json&q=fibonacci&start=0'

In [63]:
doc.keys()


Out[63]:
dict_keys(['greeting', 'query', 'count', 'start', 'results'])

In [64]:
results = doc['results']
results[0]['comment'][:10]


Out[64]:
["Also sometimes called Lamé's sequence.",
 "F(n+2) = number of binary sequences of length n that have no consecutive 0's.",
 'F(n+2) = number of subsets of {1,2,...,n} that contain no consecutive integers.',
 'F(n+1) = number of tilings of a 2 X n rectangle by 2 X 1 dominoes.',
 'F(n+1) = number of matchings (i.e., Hosoya index) in a path graph on n vertices: F(5)=5 because the matchings of the path graph on the vertices A, B, C, D are the empty set, {AB}, {BC}, {CD} and {AB, CD}. - _Emeric Deutsch_, Jun 18 2001',
 'F(n) = number of compositions of n+1 with no part equal to 1. [Cayley, Grimaldi]',
 'Positive terms are the solutions to z = 2*x*y^4 + (x^2)*y^3 - 2*(x^3)*y^2 - y^5 - (x^4)*y + 2*y for x,y >= 0 (Ribenboim, page 193). When x=F(n), y=F(n + 1) and z>0 then z=F(n + 1).',
 'For Fibonacci search see Knuth, Vol. 3; Horowitz and Sahni; etc.',
 "F(n) is the diagonal sum of the entries in Pascal's triangle at 45 degrees slope. - _Amarnath Murthy_, Dec 29 2001",
 'F(n+1) is the number of perfect matchings in ladder graph L_n = P_2 X P_n. - Sharon Sela (sharonsela(AT)hotmail.com), May 19 2002']

In [65]:
Markdown(pretty_print(doc['results'][0], 
                      comment=lambda i,c: "binomial" in c,
                      formula=lambda i,f: "theorem" in f,
                      link=lambda i,l: "paul barry" in l,
                      reference=lambda i,r: "riordan" in r))


Out[65]:
A000045: Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.

by N. J. A. Sloane, 1964

Keywords: nonn,core,nice,easy,hear

Data:

$$ \begin{array}{c|ccccccccccccccc } n & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\ \hline A000045(n) & 0 & 1 & 1 & 2 & 3 & 5 & 8 & 13 & 21 & 34 & 55 & 89 & 144 & 233 & 377 \end{array} $$

Comments:

  • Fib(n+2) = Sum_{k=0..n} binomial(floor((n+k)/2),k), row sums of A046854. - Paul Barry, Mar 11 2003
  • The sequence F(n) is the binomial transformation of the alternating sequence (-1)^(n-1)F(n), whereas the sequence F(n+1) is the binomial transformation of the alternating sequence (-1)^nF(n-1). Both of these facts follow easily from the equalities a(n;1)=F(n+1) and b(n;1)=F(n) where a(n;d) and b(n;d) are so-called "delta-Fibonacci" numbers as defined in comments to A014445 (see also the papers of Witula et al.). - Roman Witula, Jul 24 2012
  • From Tom Copeland, Nov 02 2014:
    • Let P(x) = x/(1+x) with comp. inverse Pinv(x) = x/(1-x) = -P[-x], and C(x)= [1-sqrt(1-4x)]/2, an o.g.f. for the shifted Catalan numbers A000108, with inverse Cinv(x) = x * (1-x).
    • Fin(x) = P[C(x)] = C(x)/[1 + C(x)] is an o.g.f. for the Fine numbers, A000957 with inverse Fin^(-1)(x) = Cinv[Pinv(x)] = Cinv[-P(-x)].
    • Mot(x) = C[P(x)] = C[-Pinv(-x)] gives an o.g.f. for shifted A005043, the Motzkin or Riordan numbers with comp. inverse Mot^(-1)(x) = Pinv[Cinv(x)] = (x - x^2) / (1 - x + x^2) (cf. A057078).
    • BTC(x) = C[Pinv(x)] gives A007317, a binomial transform of the Catalan numbers, with BTC^(-1)(x) = P[Cinv(x)].
    • Fib(x) = -Fin[Cinv(Cinv(-x))] = -P[Cinv(-x)] = x + 2 x^2 + 3 x^3 + 5 x^4 + ... = (x+x^2)/[1-x-x^2] is an o.g.f. for the shifted Fibonacci sequence A000045, so the comp. inverse is Fib^(-1)(x) = -C[Pinv(-x)] = -BTC(-x) and Fib(x) = -BTC^(-1)(-x).
    • Generalizing to P(x,t) = x /(1 + tx) and Pinv(x,t) = x /(1 - tx) = -P(-x,t) gives other relations to lattice paths, such as the o.g.f. for A091867, C[P[x,1-t]], and that for A104597, Pinv[Cinv(x),t+1].

Formulae:

  • A sufficient condition for F(m) to be divisible by a prime p is (p - 1) divides m, if p == 1 or 4 (mod 5); (p + 1) divides m, if p == 2 or 3 (mod 5); or 5 divides m, if p = 5. (This is essentially Theorem 180 in Hardy and Wright.) - Fred W. Helenius (fredh(AT)ix.netcom.com), Jun 29 2001
  • Kurmang. Aziz. Rashid, Feb 21 2004, makes 4 conjectures and gives 3 theorems:
  • Theorem 1: for n>=0, {F(n+3)^ 2 - F(n+1)^ 2}/F(n+2)={F(n+3)+ F(n+1)}.
  • Theorem 2: for n>=0, F(n+10) = 11*F(n+5) + F(n).
  • Theorem 3: for n>=6, F(n) = 4*F(n-3) + F(n-6).

Cross references:

Links:

References:

  • J. Riordan, An Introduction to Combinatorial Analysis, Princeton University Press, Princeton, NJ, 1978.