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

A058331 a(n) = 2*n^2 + 1.

Original entry on oeis.org

1, 3, 9, 19, 33, 51, 73, 99, 129, 163, 201, 243, 289, 339, 393, 451, 513, 579, 649, 723, 801, 883, 969, 1059, 1153, 1251, 1353, 1459, 1569, 1683, 1801, 1923, 2049, 2179, 2313, 2451, 2593, 2739, 2889, 3043, 3201, 3363, 3529, 3699, 3873, 4051
Offset: 0

Views

Author

Erich Friedman, Dec 12 2000

Keywords

Comments

Maximal number of regions in the plane that can be formed with n hyperbolas.
Also the number of different 2 X 2 determinants with integer entries from 0 to n.
Number of lattice points in an n-dimensional ball of radius sqrt(2). - David W. Wilson, May 03 2001
Equals A112295(unsigned) * [1, 2, 3, ...]. - Gary W. Adamson, Oct 07 2007
Binomial transform of A166926. - Gary W. Adamson, May 03 2008
a(n) = longest side a of all integer-sided triangles with sides a <= b <= c and inradius n >= 1. Triangle has sides (2n^2 + 1, 2n^2 + 2, 4n^2 + 1).
{a(k): 0 <= k < 3} = divisors of 9. - Reinhard Zumkeller, Jun 17 2009
Number of ways to partition a 3*n X 2 grid into 3 connected equal-area regions. - R. H. Hardin, Oct 31 2009
Let A be the Hessenberg matrix of order n defined by: A[1, j] = 1, A[i, i] := 2, (i > 1), A[i, i - 1] = -1, and A[i, j] = 0 otherwise. Then, for n >= 3, a(n - 1) = coeff(charpoly(A, x), x^(n - 2)). - Milan Janjic, Jan 26 2010
Except for the first term of [A002522] and [A058331] if X = [A058331], Y = [A087113], A = [A002522], we have, for all other terms, Pell's equation: [A058331]^2 - [A002522]*[A087113]^2 = 1; (X^2 - A*Y^2 = 1); e.g., 3^2 -2*2^2 = 1; 9^2 - 5*4^2 = 1; 129^2 - 65*16^2 = 1, and so on. - Vincenzo Librandi, Aug 07 2010
Niven (1961) gives this formula as an example of a formula that does not contain all odd integers, in contrast to 2n + 1 and 2n - 1. - Alonso del Arte, Dec 05 2012
Numbers m such that 2*m-2 is a square. - Vincenzo Librandi, Apr 10 2015
Number of n-tuples from the set {1,0,-1} where at most two elements are nonzero. - Michael Somos, Oct 19 2022
a(n) gives the x-value of the integral solution (x,y) of the Pellian equation x^2 - (n^2 + 1)*y^2 = 1. The y-value is given by 2*n (see Tattersall). - Stefano Spezia, Jul 23 2025

Examples

			a(1) = 3 since (0 0 / 0 0), (1 0 / 0 1) and (0 1 / 1 0) have different determinants.
G.f. = 1 + 3*x + 9*x^2 + 19*x^3 + 33*x^4 + 51*x^5 + 73*x^6 + ... - _Michael Somos_, Oct 19 2022
		

References

  • Ivan Niven, Numbers: Rational and Irrational, New York: Random House for Yale University (1961): 17.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 256.

Crossrefs

Cf. A000124.
Second row of array A099597.
See A120062 for sequences related to integer-sided triangles with integer inradius n.
Cf. A112295.
Column 2 of array A188645.
Cf. A001105 and A247375. - Bruno Berselli, Sep 16 2014

Programs

  • Haskell
    a058331 = (+ 1) . a001105  -- Reinhard Zumkeller, Dec 13 2014
    
  • Magma
    [2*n^2 + 1 : n in [0..100]]; // Wesley Ivan Hurt, Feb 02 2017
  • Mathematica
    b[g_] := Length[Union[Map[Det, Flatten[ Table[{{i, j}, {k, l}}, {i, 0, g}, {j, 0, g}, {k, 0, g}, {l, 0, g}], 3]]]] Table[b[g], {g, 0, 20}]
    2*Range[0, 49]^2 + 1 (* Alonso del Arte, Dec 05 2012 *)
  • PARI
    a(n)=2*n^2+1 \\ Charles R Greathouse IV, Jun 16 2011
    

Formula

G.f.: (1 + 3x^2)/(1 - x)^3. - Paul Barry, Apr 06 2003
a(n) = M^n * [1 1 1], leftmost term, where M = the 3 X 3 matrix [1 1 1 / 0 1 4 / 0 0 1]. a(0) = 1, a(1) = 3; a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). E.g., a(4) = 33 since M^4 *[1 1 1] = [33 17 1]. - Gary W. Adamson, Nov 11 2004
a(n) = cosh(2*arccosh(n)). - Artur Jasinski, Feb 10 2010
a(n) = 4*n + a(n-1) - 2 for n > 0, a(0) = 1. - Vincenzo Librandi, Aug 07 2010
a(n) = (((n-1)^2 + n^2))/2 + (n^2 + (n+1)^2)/2. - J. M. Bergot, May 31 2012
a(n) = A251599(3*n) for n > 0. - Reinhard Zumkeller, Dec 13 2014
a(n) = sqrt(8*(A000217(n-1)^2 + A000217(n)^2) + 1). - J. M. Bergot, Sep 03 2015
E.g.f.: (2*x^2 + 2*x + 1)*exp(x). - G. C. Greubel, Jul 14 2017
a(n) = A002378(n) + A002061(n). - Bruce J. Nicholson, Aug 06 2017
From Amiram Eldar, Jul 15 2020: (Start)
Sum_{n>=0} 1/a(n) = (1 + (Pi/sqrt(2))*coth(Pi/sqrt(2)))/2.
Sum_{n>=0} (-1)^n/a(n) = (1 + (Pi/sqrt(2))*csch(Pi/sqrt(2)))/2. (End)
From Amiram Eldar, Feb 05 2021: (Start)
Product_{n>=0} (1 + 1/a(n)) = sqrt(2)*csch(Pi/sqrt(2))*sinh(Pi).
Product_{n>=1} (1 - 1/a(n)) = (Pi/sqrt(2))*csch(Pi/sqrt(2)). (End)
From Leo Tavares, May 23 2022: (Start)
a(n) = A000384(n+1) - 3*n.
a(n) = 3*A000217(n) + A000217(n-2). (End)
a(n) = a(-n) for all n in Z and A037235(n) = Sum_{k=0..n-1} a(k). - Michael Somos, Oct 19 2022

Extensions

Revised description from Noam Katz (noamkj(AT)hotmail.com), Jan 28 2001

A000127 Maximal number of regions obtained by joining n points around a circle by straight lines. Also number of regions in 4-space formed by n-1 hyperplanes.

Original entry on oeis.org

1, 2, 4, 8, 16, 31, 57, 99, 163, 256, 386, 562, 794, 1093, 1471, 1941, 2517, 3214, 4048, 5036, 6196, 7547, 9109, 10903, 12951, 15276, 17902, 20854, 24158, 27841, 31931, 36457, 41449, 46938, 52956, 59536, 66712, 74519, 82993, 92171, 102091, 112792, 124314, 136698
Offset: 1

Views

Author

Keywords

Comments

a(n) is the sum of the first five terms in the n-th row of Pascal's triangle. - Geoffrey Critzer, Jan 18 2009
{a(k): 1 <= k <= 5} = divisors of 16. - Reinhard Zumkeller, Jun 17 2009
Equals binomial transform of [1, 1, 1, 1, 1, 0, 0, 0, ...]. - Gary W. Adamson, Mar 02 2010
From Bernard Schott, Apr 05 2021: (Start)
As a(n) = 2^(n-1) for n = 1..5, it is misleading to believe that a(n) = 2^(n-1) for n > 5 (see Patrick Popescu-Pampu link); other curiosities: a(6) = 2^5 - 1 and a(10) = 2^8.
The sequence of the first differences is A000125, the sequence of the second differences is A000124, the sequence of the third differences is A000027 and the sequence of the fourth differences is the all 1's sequence A000012 (see J. H. Conway and R. K. Guy reference, p. 80). (End)
a(n) is the number of binary words of length n matching the regular expression 0*1*0*1*0*. A000124 and A000125 count binary words of the form 0*1*0* and 1*0*1*0*, respectively. - Manfred Scheucher, Jun 22 2023

Examples

			a(7)=99 because the first five terms in the 7th row of Pascal's triangle are 1 + 7 + 21 + 35 + 35 = 99. - _Geoffrey Critzer_, Jan 18 2009
G.f. = x + 2*x^2 + 4*x^3 + 8*x^4 + 16*x^5 + 31*x^6 + 57*x^7 + 99*x^8 + 163*x^9 + ...
		

References

  • R. B. Banks, Slicing Pizzas, Racing Turtles and Further Adventures in Applied Mathematics, Princeton Univ. Press, 1999. See p. 28.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.
  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, Chap. 3.
  • J. H. Conway and R. K. Guy, Le Livre des Nombres, Eyrolles, 1998, p. 80.
  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique Des Nombres, Problem 33 pp. 18; 128 Ellipses Paris 2004.
  • A. Deledicq and D. Missenard, A La Recherche des Régions Perdues, Math. & Malices, No. 22 Summer 1995 issue pp. 22-3 ACL-Editions Paris.
  • M. Gardner, Mathematical Circus, pp. 177; 180-1 Alfred A. Knopf NY 1979.
  • M. Gardner, The Colossal Book of Mathematics, 2001, p. 561.
  • James Gleick, Faster, Vintage Books, NY, 2000 (see pp. 259-261).
  • M. de Guzman, Aventures Mathématiques, Prob. B pp. 115-120 PPUR Lausanne 1990.
  • Ross Honsberger; Mathematical Gems I, Chap. 9.
  • Ross Honsberger; Mathematical Morsels, Chap. 3.
  • Jeux Mathématiques et Logiques, Vol. 3 pp. 12; 51 Prob. 14 FFJM-SERMAP Paris 1988.
  • J. N. Kapur, Reflections of a Mathematician, Chap.36, pp. 337-343, Arya Book Depot, New Delhi 1996.
  • C. D. Miller, V. E. Heeren, J. Hornsby, M. L. Morrow and J. Van Newenhizen, Mathematical Ideas, Tenth Edition, Pearson, Addison-Wesley, Boston, 2003, Cptr 1, 'The Art of Problem Solving, page 6.
  • I. Niven, Mathematics of Choice, pp. 158; 195 Prob. 40 NML 15 MAA 1965.
  • C. S. Ogilvy, Tomorrow's Math, pp. 144-6 OUP 1972.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 252-255.
  • Alfred S. Posamentier & Ingmar Lehmann, The (Fabulous) Fibonacci Numbers, Prometheus Books, NY, 2007, page 81-87.
  • A. 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 and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a000127 = sum . take 5 . a007318_row  -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [(n^4-6*n^3+23*n^2-18*n+24)/24: n in [1..50]]; // Vincenzo Librandi, Feb 16 2015
    
  • Maple
    A000127 := n->(n^4 - 6*n^3 + 23*n^2 - 18*n + 24)/24;
    with (combstruct):ZL:=[S, {S=Sequence(U, card=1)}, unlabeled]: seq(count(subs(r=6, ZL), size=m), m=0..41); # Zerinvary Lajos, Mar 08 2008
  • Mathematica
    f[n_] := Sum[Binomial[n, i], {i, 0, 4}]; Table[f@n, {n, 0, 40}] (* Robert G. Wilson v, Jun 29 2007 *)
    Total/@Table[Binomial[n-1,k],{n,50},{k,0,4}] (* or *) LinearRecurrence[ {5,-10,10,-5,1},{1,2,4,8,16},50] (* Harvey P. Dale, Aug 24 2011 *)
    Table[(n^4 - 6 n^3 + 23 n^2 - 18 n + 24) / 24, {n, 100}] (* Vincenzo Librandi, Feb 16 2015 *)
    a[ n_] := Binomial[n, 4] + Binomial[n, 2] + 1; (* Michael Somos, Dec 23 2017 *)
  • PARI
    a(n)=(n^4-6*n^3+23*n^2-18*n+24)/24 \\ Charles R Greathouse IV, Mar 22 2016
    
  • PARI
    {a(n) = binomial(n, 4) + binomial(n, 2) + 1}; /* Michael Somos, Dec 23 2017 */
    
  • Python
    def A000127(n): return n*(n*(n*(n - 6) + 23) - 18)//24 + 1 # Chai Wah Wu, Sep 18 2021

Formula

a(n) = C(n-1, 4) + C(n-1, 3) + ... + C(n-1, 0) = A055795(n) + 1 = C(n, 4) + C(n-1, 2) + n.
a(n) = Sum_{k=0..2} C(n, 2k). - Joel Sanderi (sanderi(AT)itstud.chalmers.se), Sep 08 2004
a(n) = (n^4 - 6*n^3 + 23*n^2 - 18*n + 24)/24.
G.f.: (1 - 3*x + 4*x^2 - 2*x^3 + x^4)/(1-x)^5. (for offset 0) - Simon Plouffe in his 1992 dissertation
E.g.f.: (1 + x + x^2/2 + x^3/6 + x^4/24)*exp(x) (for offset 0). [Typos corrected by Juan M. Marquez, Jan 24 2011]
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5), n > 4. - Harvey P. Dale, Aug 24 2011
a(n) = A000124(A000217(n-1)) - n*A000217(n-2) - A034827(n), n > 1. - Melvin Peralta, Feb 15 2016
a(n) = A223718(-n). - Michael Somos, Dec 23 2017
For n > 2, a(n) = n + 1 + sum_{i=2..(n-2)}sum_{j=1..(n-i)}(1+(i-1)(j-1)). - Alec Jones, Nov 17 2019

Extensions

Formula corrected and additional references from torsten.sillke(AT)lhsystems.com
Additional correction from Jonas Paulson (jonasso(AT)sdf.lonestar.org), Oct 30 2003

A008949 Triangle read by rows of partial sums of binomial coefficients: T(n,k) = Sum_{i=0..k} binomial(n,i) (0 <= k <= n); also dimensions of Reed-Muller codes.

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 1, 4, 7, 8, 1, 5, 11, 15, 16, 1, 6, 16, 26, 31, 32, 1, 7, 22, 42, 57, 63, 64, 1, 8, 29, 64, 99, 120, 127, 128, 1, 9, 37, 93, 163, 219, 247, 255, 256, 1, 10, 46, 130, 256, 382, 466, 502, 511, 512, 1, 11, 56, 176, 386, 638, 848, 968, 1013, 1023, 1024, 1, 12, 67, 232, 562, 1024, 1486, 1816, 1981, 2036, 2047, 2048
Offset: 0

Views

Author

Keywords

Comments

The second-left-from-middle column is A000346: T(2n+2, n) = A000346(n). - Ed Catmur (ed(AT)catmur.co.uk), Dec 09 2006
T(n,k) is the maximal number of regions into which n hyperplanes of co-dimension 1 divide R^k (the Cake-Without-Icing numbers). - Rob Johnson, Jul 27 2008
T(n,k) gives the number of vertices within distance k (measured along the edges) of an n-dimensional unit cube, (i.e., the number of vertices on the hypercube graph Q_n whose distance from a reference vertex is <= k). - Robert Munafo, Oct 26 2010
A triangle formed like Pascal's triangle, but with 2^n for n >= 0 on the right border instead of 1. - Boris Putievskiy, Aug 18 2013
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 04 2013
Consider each "1" as an apex of two sequences: the first is the set of terms in the same row as the "1", but the rightmost term in the row repeats infinitely. Example: the row (1, 4, 7, 8) becomes (1, 4, 7, 8, 8, 8, ...). The second sequence begins with the same "1" but is the diagonal going down and to the right, thus: (1, 5, 16, 42, 99, 219, 466, ...). It appears that for all such sequence pairs, the binomial transform of the first, (1, 4, 7, 8, 8, 8, ...) in this case; is equal to the second: (1, 5, 16, 42, 99, ...). - Gary W. Adamson, Aug 19 2015
Let T* be the infinite tree with root 0 generated by these rules: if p is in T*, then p+1 is in T* and x*p is in T*. Let q(n) be the sum of polynomials in the n-th generation of T*. For n >= 0, row n of A008949 gives the coefficients of q(n+1); e.g., (row 3) = (1, 4, 7, 8) matches x^3 + 4*x^2 + 7*x + 9, which is the sum of the 8 polynomials in the 4th generation of T*. - Clark Kimberling, Jun 16 2016
T(n,k) is the number of subsets of [n]={1,...,n} of at most size k. Equivalently, T(n,k) is the number of subsets of [n] of at least size n-k. Counting the subsets of at least size (n-k) by conditioning on the largest element m of the smallest (n-k) elements of such a subset provides the formula T(n,k) = Sum_{m=n-k..n} C(m-1,n-k-1)*2^(n-m), and, by letting j=m-n+k, we obtain T(n,k) = Sum_{j=0..k} C(n+j-k-1,j)*2^(k-j). - Dennis P. Walsh, Sep 25 2017
If the interval of integers 1..n is shifted up or down by k, making the new interval 1+k..n+k or 1-k..n-k, then T(n-1,n-1-k) (= 2^(n-1)-T(n-1,k-1)) is the number of subsets of the new interval that contain their own cardinal number as an element. - David Pasino, Nov 01 2018

Examples

			Triangle begins:
  1;
  1,  2;
  1,  3,  4;
  1,  4,  7,   8;
  1,  5, 11,  15,  16;
  1,  6, 16,  26,  31,  32;
  1,  7, 22,  42,  57,  63,  64;
  1,  8, 29,  64,  99, 120, 127, 128;
  1,  9, 37,  93, 163, 219, 247, 255,  256;
  1, 10, 46, 130, 256, 382, 466, 502,  511,  512;
  1, 11, 56, 176, 386, 638, 848, 968, 1013, 1023, 1024;
  ...
		

References

  • F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, Elsevier-North Holland, 1978, p. 376.

Crossrefs

Row sums sequence is A001792.
T(n, m)= A055248(n, n-m).

Programs

  • GAP
    T:=Flat(List([0..11],n->List([0..n],k->Sum([0..k],j->Binomial(n+j-k-1,j)*2^(k-j))))); # Muniru A Asiru, Nov 25 2018
    
  • Haskell
    a008949 n k = a008949_tabl !! n !! k
    a008949_row n = a008949_tabl !! n
    a008949_tabl = map (scanl1 (+)) a007318_tabl
    -- Reinhard Zumkeller, Nov 23 2012
    
  • Magma
    [[(&+[Binomial(n,j): j in [0..k]]): k in [0..n]]: n in [0..12]]; // G. C. Greubel, Nov 25 2018
    
  • Maple
    A008949 := proc(n,k) local i; add(binomial(n,i),i=0..k) end; # Typo corrected by R. J. Mathar, Oct 26 2010
  • Mathematica
    Table[Length[Select[Subsets[n], (Length[ # ] <= k) &]], {n, 0, 12}, {k, 0, n}] // Grid (* Geoffrey Critzer, May 13 2009 *)
    Flatten[Accumulate/@Table[Binomial[n,i],{n,0,20},{i,0,n}]] (* Harvey P. Dale, Aug 08 2015 *)
    T[ n_, k_] := If[ n < 0 || k > n, 0, Binomial[n, k] Hypergeometric2F1[1, -k, n + 1 - k, -1]]; (* Michael Somos, Aug 05 2017 *)
  • PARI
    A008949(n)=T8949(t=sqrtint(2*n-sqrtint(2*n)),n-t*(t+1)/2)
    T8949(r,c)={ 2*c > r || return(sum(i=0,c,binomial(r,i))); 1<M. F. Hasler, May 30 2010
    
  • PARI
    {T(n, k) = if(k>n, 0, sum(i=0, k, binomial(n, i)))}; /* Michael Somos, Aug 05 2017 */
    
  • PARI
    row(n) = my(v=vector(n+1, k, binomial(n,k-1))); vector(#v, k, sum(i=1, k, v[i])); \\ Michel Marcus, Apr 13 2025
    
  • Sage
    [[sum(binomial(n,j) for j in range(k+1)) for k in range(n+1)] for n in range(12)] # G. C. Greubel, Nov 25 2018

Formula

From partial sums across rows of Pascal triangle A007318.
T(n, 0) = 1, T(n, n) = 2^n, T(n, k) = T(n-1, k-1) + T(n-1, k), 0 < k < n.
G.f.: (1 - x*y)/((1 - y - x*y)*(1 - 2*x*y)). - Antonio Gonzalez (gonfer00(AT)gmail.com), Sep 08 2009
T(2n,n) = A032443(n). - Philippe Deléham, Sep 16 2009
T(n,k) = 2 T(n-1,k-1) + binomial(n-1,k) = 2 T(n-1,k) - binomial(n-1,k). - M. F. Hasler, May 30 2010
T(n,k) = binomial(n,n-k)* 2F1(1, -k; n+1-k; -1). - Olivier Gérard, Aug 02 2012
For a closed-form formula for arbitrary left and right borders of Pascal like triangle see A228196. - Boris Putievskiy, Aug 18 2013
T(n,floor(n/2)) = A027306(n). - Reinhard Zumkeller, Nov 14 2014
T(n,n) = 2^n, otherwise for 0 <= k <= n-1, T(n,k) = 2^n - T(n,n-k-1). - Bob Selcoe, Mar 30 2017
For fixed j >= 0, lim_{n -> oo} T(n+1,n-j+1)/T(n,n-j) = 2. - Bob Selcoe, Apr 03 2017
T(n,k) = Sum_{j=0..k} C(n+j-k-1,j)*2^(k-j). - Dennis P. Walsh, Sep 25 2017

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 23 2000

A077028 The rascal triangle, read by rows: T(n,k) (n >= 0, 0 <= k <= n) = k(n-k) + 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 5, 4, 1, 1, 5, 7, 7, 5, 1, 1, 6, 9, 10, 9, 6, 1, 1, 7, 11, 13, 13, 11, 7, 1, 1, 8, 13, 16, 17, 16, 13, 8, 1, 1, 9, 15, 19, 21, 21, 19, 15, 9, 1, 1, 10, 17, 22, 25, 26, 25, 22, 17, 10, 1, 1, 11, 19, 25, 29, 31, 31, 29, 25, 19, 11, 1, 1, 12, 21, 28, 33, 36, 37, 36, 33, 28, 21, 12, 1
Offset: 0

Views

Author

Clark Kimberling, Oct 19 2002

Keywords

Comments

Pascal's triangle is formed using the rule South = West + East, whereas the rascal triangle uses the rule South = (West*East+1)/North. [Anggoro et al.]
The n-th diagonal is congruent to 1 mod n-1.
Row sums are the cake numbers, A000125. Alternating sum of row n is 0 if n even and (3-n)/2 if n odd. Rows are symmetric, beginning and ending with 1. The number of occurrences of k in this triangle is the number of divisors of k-1, given by A000005.
The triangle can be generated by numbers of the form k*(n-k) + 1 for k = 0 to n. Conjecture: except for n = 0,1 and 6 every row contains a prime. - Amarnath Murthy, Jul 15 2005
Above conjecture needs more exceptions, rows 30 and 54 do not contain primes. - Alois P. Heinz, Aug 31 2017
From Moshe Shmuel Newman, Apr 06 2008: (Start)
Consider the semigroup of words in x,y,q subject to the relationships: yx = xyq, qx = xq, qy = yq.
Now take words of length n in x and y, with exactly k y's. If there had been no relationships, the number of different words of this type would be n choose k, sequence A007318. Thanks to the relationships, the number of words of this type is the k-th entry in the n-th row of this sequence (read as a triangle, with the first row indexed by zero and likewise the first entry in each row.)
For example: with three letters and one y, we have three possibilities: xxy, xyx = xxyq, yxx = xxyqq. No two of them are equal, so this entry is still 3, as in Pascal's triangle.
With four letters, two y's, we have the first reduction: xyyx = yxxy = xxyyqq and this is the only reduction for 4 letters. So the middle entry of the fourth row is 5 instead of 6, as in the Pascal triangle. (End)
Main diagonals of this triangle sum to polygonal numbers. See A057145. - Raphie Frank, Oct 30 2012
T(n,k) gives the number of distinct sums of k elements in {1,2,...,n}, e.g., T(5,4) = the number of distinct sums of 4 elements in {1,2,3,4,5}, which is (5+4+3+2) - (4+3+2+1) + 1 = 5. - Derek Orr, Nov 26 2014
Conjecture: excluding the starting and ending 1's in each row, those that contain only prime numbers are n = 2, 3, 5, 7, 13, and 17. Tested up to row 10^9. - Rogério Serôdio, Sep 20 2017
The rascal triangle also uses the rule South = (West+East+1)-North. [Abstracts of AMS, Winter 2019, p. 526, 1145-VS-280, refers to Julian Fleron] - Michael Somos, Jan 12 2019
As a square array read by antidiagonals, selecting terms that give a remainder of 1 when divided by a prime gives evenly sized squares. For example, when each term is divided by 2, showing the remainder looks like:
1 1 1 1 1
1 0 1 0 1
1 1 1 1 1
1 0 1 0 1
1 1 1 1 1 - Nathaniel J. Strout, Jan 01 2020
T(n,k) is the number of binary words of length n which contain exactly k 1s and have at most 1 ascent. T(n,k) is also the number of ascent sequences avoiding 001 and 210 with length n+1 and exactly k ascents. - Amelia Gibbs, May 21 2024
T(n,k) represents the first and foundational instance R1 of a new family of Pascal-like triangles called Iterated Rascal triangles; A374378 is triangle R2; A374452 is triangle R3. - Kolosov Petro, Sep 28 2024

Examples

			Third diagonal (1,3,5,7,...) consists of the positive integers congruent to 1 mod 2.
The triangle T(n, k) begins:
  n\k  0  1  2  3  4  5  6  7  8  9 10 ...
  0:   1
  1:   1  1
  2:   1  2  1
  3:   1  3  3  1
  4:   1  4  5  4  1
  5:   1  5  7  7  5  1
  6:   1  6  9 10  9  6  1
  7:   1  7 11 13 13 11  7  1
  8:   1  8 13 16 17 16 13  8  1
  9:   1  9 15 19 21 21 19 15  9  1
 10:   1 10 17 22 25 26 25 22 17 10  1
 ... reformatted. - _Wolfdieter Lang_, Dec 19 2017
As a square array read by antidiagonals, the first rows are:
  1,  1,  1,  1,  1,  1, ...
  1,  2,  3,  4,  5,  6, ...
  1,  3,  5,  7,  9, 11, ...
  1,  4,  7, 10, 13, 16, ...
  1,  5,  9, 13, 17, 21, ...
		

Crossrefs

The maximum value for each antidiagonal is given by sequence A033638.
Equals A004247(n) + 1.

Programs

  • Maple
    A077028 := proc(n,k)
       if n <0 or k<0 or k > n then
           0;
       else
           k*(n-k)+1 ;
       end if;
    end proc: # R. J. Mathar, Jul 28 2016
  • Mathematica
    t[n_, k_] := k (n - k) + 1; t[0, 0] = 1; Table[ t[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Robert G. Wilson v, Jul 06 2012 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, k * (n - k) + 1)}; /* Michael Somos, Mar 20 2011 */

Formula

As a square array read by antidiagonals, a(n, k) = 1 + n*k. a(n, k) = a(n-1, k) + k. Row n has g.f. (1+(n-1)x)/(1-x)^2, n >= 0. - Paul Barry, Feb 22 2003
Still thinking of square arrays. Let f:N->Z and g:N->Z be given and I an integer, then define a(n, k) = I + f(n)*g(k). Then a(n, k)*a(n-1, k-1) = a(n-1, k)*a(n, k-1) + I*(f(n) - f(n-1))*(g(k) - g(k-1)) for suitable n and k. S= (E*W + 1)/N. arises with I = 1, and f = g = id. - Terry Lindgren, Apr 10 2011
Using the above: Having just read J. Fleron's nice article in Discovering the Art of Mathematics on the rascal triangle, it is neat to note and straightforward to show that when I = 1, a(n, k) + a(n-1, k-1) = a(n-1, k) + a(n, k-1) + (f(n) - f(n-1))*(g(k) - g(k-1)), so with I = 1, and f = g = id, we have S+N = E+W + 1, as his students discovered. - Terry Lindgren, Nov 28 2016
T(n, k) = A128139(n-1, k-1). - Gary W. Adamson, Jul 02 2012
O.g.f. (1 - x*(1 + t) + 2*t*x^2)/((1 - x)^2*(1 - t*x)^2) = 1 + (1 + t)*x + (1 + 2*t + t^2)*x^2 + .... Cf. A105851. - Peter Bala, Jul 26 2015
T(n, k) = 0 if n < k, T(n, 0) = 1, T(n,n) = 1, for n >= 0, and T(n, k) = (T(n-1, k-1)*T(n-1, k) + 1)/(T(n-2, k-1)) for 0 < k < n. See the first comment referring to the triangle with its apex in the middle. - Wolfdieter Lang, Dec 19 2017
E.g.f. as square array: exp(x+y)*(1 + x*y). - Stefano Spezia, Aug 10 2025

Extensions

Better definition based on Murthy's comment of Jul 15 2005 and the Anggoro et al. paper. - N. J. A. Sloane, Mar 05 2011

A006261 a(n) = Sum_{k=0..5} binomial(n,k).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 63, 120, 219, 382, 638, 1024, 1586, 2380, 3473, 4944, 6885, 9402, 12616, 16664, 21700, 27896, 35443, 44552, 55455, 68406, 83682, 101584, 122438, 146596, 174437, 206368, 242825, 284274, 331212, 384168, 443704, 510416, 584935, 667928, 760099, 862190
Offset: 0

Views

Author

N. J. A. Sloane, based on a suggestion from S. C. Chan, Jun 10 1975

Keywords

Comments

a(n) is the sum of the first six terms of the n-th row in Pascal's triangle. - Geoffrey Critzer, Jan 19 2009
Also the interpolating polynomial for the divisors of 32: {a(k): 0 <= k < 6} = {1,2,4,8,16,32}. - Reinhard Zumkeller, Jun 17 2009
a(n) is the maximal number of regions in 5-space formed by n-1 4-dimensional hypercubes. - Carl Schildkraut, May 26 2015
a(n) is the number of binary words of length n matching the regular expression 1*0*1*0*1*0*. A000124, A000125, A000127 count binary words of the form 0*1*0*, 1*0*1*0*, and 0*1*0*1*0*, respectively. - Manfred Scheucher, Jun 22 2023

Examples

			a(7) = 120 because the first six terms in the 7th row of Pascal's triangle 1 + 7 + 21 + 35 + 35 + 21 = 120. - _Geoffrey Critzer_, Jan 19 2009
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 72, Problem 2.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006261 = sum . take 6 . a007318_row  -- Reinhard Zumkeller, Nov 24 2012
    
  • Magma
    [(n^5 - 5*n^4 + 25*n^3 + 5*n^2 + 94*n + 120)/120: n in [0..40]]; // Vincenzo Librandi, Jul 17 2011
    
  • Maple
    A006261:=(z**2-z+1)*(3*z**2-3*z+1)/(z-1)**6; # Simon Plouffe in his 1992 dissertation
  • Mathematica
    CoefficientList[
      Series[(1 + x + x^2/2 + x^3/6 + x^4/24 + x^5/120) Exp[x], {x, 0,
        52}], x]*Table[n!, {n, 0, 52}]
  • PARI
    a(n)=sum(k=0,5,binomial(n,k)) \\ Charles R Greathouse IV, Apr 08 2016
  • Python
    A006261_list, m = [], [1, -3, 4, -2, 1, 1]
    for _ in range(10**2):
        A006261_list.append(m[-1])
        for i in range(5):
            m[i+1] += m[i] # Chai Wah Wu, Jan 24 2016
    
  • Sage
    [binomial(n,1)+binomial(n,3)+binomial(n,5) for n in range(1, 38)] # Zerinvary Lajos, May 17 2009
    

Formula

a(n) = A057703(n) + 1.
a(n) = binomial(n+1, 5) + binomial(n+1, 3) + binomial(n+1, 1). - Len Smiley, Oct 20 2001
G.f.: (1 - 4*x + 7*x^2 - 6*x^3 + 3*x^4)/(1-x)^6. - Geoffrey Critzer, Jan 19 2009
E.g.f.: (1 + x + x^2/2 + x^3/6 + x^4/24 + x^5/120)*exp(x).
a(n) = (n^5 - 5*n^4 + 25*n^3 + 5*n^2 + 94*n + 120)/120. - Reinhard Zumkeller, Jun 17 2009
a(n) = a(n-1) + A000127(n-1). - Christian Schroeder, Jan 04 2016

A161700 a(n) is the sum of the elements on the antidiagonal of the difference table of the divisors of n.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 13, 15, 19, 17, 21, 28, 25, 21, 41, 31, 33, 59, 37, 21, 53, 29, 45, 39, 61, 33, 65, 49, 57, 171, 61, 63, 77, 41, 117, 61, 73, 45, 89, -57, 81, 309, 85, 105, 167, 53, 93, -80, 127, 61, 113, 133, 105, 321, 173, 183, 125, 65, 117, -1039, 121, 69, 155, 127, 201, 333, 133, 189, 149, -69, 141, 117, 145, 81, 317, 217, 269
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 17 2009, Jun 20 2009

Keywords

Comments

a(p^k) = p^(k+1) - (p-1)^(k+1) if p is prime. - Robert Israel, May 18 2016

Examples

			n=12: A000005(12)=6;
EDP(12,x) = (x^5 - 5*x^4 + 5*x^3 + 5*x^2 + 114*x + 120)/120 = A161701(x) is the interpolating polynomial for {(0,1),(1,2),(2,3),(3,4),(4,6),(5,12)},
{EDP(12,x): 0<=x<6} = {1, 2, 3, 4, 6, 12} = divisors of 12,
a(12) = EDP(12,6) = 28.
From _Peter Luschny_, May 18 2016: (Start)
a(40) = -57 because the sum of the elements on the antidiagonal of DTD(40) is -57.
The DTD(40) is:
[   1    2    4   5  8  10  20  40]
[   1    2    1   3  2  10  20   0]
[   1   -1    2  -1  8  10   0   0]
[  -2    3   -3   9  2   0   0   0]
[   5   -6   12  -7  0   0   0   0]
[ -11   18  -19   0  0   0   0   0]
[  29  -37    0   0  0   0   0   0]
[ -66    0    0   0  0   0   0   0]
(End)
		

Crossrefs

Programs

  • Maple
    f:= proc(n)
    local D, nD;
    D:= sort(convert(numtheory:-divisors(n),list));
    nD:= nops(D);
    CurveFitting:-PolynomialInterpolation([$0..nD-1],D, nD)
    end proc:
    map(f, [$1..100]); # Robert Israel, May 18 2016
  • Mathematica
    a[n_] := (d = Divisors[n]; t = Table[Differences[d, k], {k, 0, lg = Length[d]}]; Sum[t[[lg - k + 1, k]], {k, 1, lg}]);
    Array[a, 77] (* Jean-François Alcover, Jan 25 2018 *)
  • Sage
    def A161700(n):
        D = divisors(n)
        T = matrix(ZZ, len(D))
        for (m, d) in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
        return sum(T[k,len(D)-k-1] for k in range(len(D)))
    print([A161700(n) for n in range(1,78)]) # Peter Luschny, May 18 2016

Formula

a(n) = EDP(n,tau(n)) with tau = A000005 and EDP(n,x) = interpolating polynomial for the divisors of n.
EDP(n,A000005(n) - 1) = n;
EDP(n,1) = A020639(n);
EDP(n,0) = 1;
EDP(n,k) = A027750(A006218(n-1)+k+1), 0<=k < A000005(n).

Extensions

New name from Peter Luschny, May 18 2016

A080856 a(n) = 8*n^2 - 4*n + 1.

Original entry on oeis.org

1, 5, 25, 61, 113, 181, 265, 365, 481, 613, 761, 925, 1105, 1301, 1513, 1741, 1985, 2245, 2521, 2813, 3121, 3445, 3785, 4141, 4513, 4901, 5305, 5725, 6161, 6613, 7081, 7565, 8065, 8581, 9113, 9661, 10225, 10805, 11401, 12013, 12641, 13285, 13945, 14621
Offset: 0

Views

Author

Paul Barry, Feb 23 2003

Keywords

Comments

The old definition of this sequence was "Generalized polygonal numbers".
Row T(4,n) of A080853.
{a(k): 0 <= k < 3} = divisors of 25. - Reinhard Zumkeller, Jun 17 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=4, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=3, a(n-1)= coeff(charpoly(A,x),x^(n-2)). - Milan Janjic, Jan 27 2010
Also sequence found by reading the segment (1, 5) together with the line from 5, in the direction 5, 25,..., in the square spiral whose vertices are the generalized hexagonal numbers A000217. - Omar E. Pol, Nov 05 2012
For n > 0: A049061(a(n)) = 0, when the triangle of "signed Eulerian numbers" in A049061 is seen as flattened sequence. - Reinhard Zumkeller, Jan 31 2013

Crossrefs

A060820 is another version (but the present sequence is the main entry).
A row of the array in A386478.

Programs

Formula

G.f.: (1+2*x+13*x^2)/(1-x)^3.
a(n) = A060820(n), n>0. - R. J. Mathar, Sep 18 2008
a(n) = C(n,0) + 4*C(n,1) + 16*C(n,2). - Reinhard Zumkeller, Jun 17 2009
a(n) = 16*n+a(n-1)-12 with n>0, a(0)=1. - Vincenzo Librandi, Aug 08 2010
E.g.f.: (8*x^2 + 4*x + 1)*exp(x). - G. C. Greubel, Jun 16 2017

Extensions

Definition replaced with the closed form by Bruno Berselli, Jan 16 2013

A004070 Table of Whitney numbers W(n,k) read by antidiagonals, where W(n,k) is maximal number of pieces into which n-space is sliced by k hyperplanes, n >= 0, k >= 0.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 4, 4, 1, 1, 2, 4, 7, 5, 1, 1, 2, 4, 8, 11, 6, 1, 1, 2, 4, 8, 15, 16, 7, 1, 1, 2, 4, 8, 16, 26, 22, 8, 1, 1, 2, 4, 8, 16, 31, 42, 29, 9, 1, 1, 2, 4, 8, 16, 32, 57, 64, 37, 10, 1, 1, 2, 4, 8, 16, 32, 63, 99, 93, 46, 11, 1, 1, 2, 4, 8, 16, 32, 64, 120, 163
Offset: 0

Views

Author

Keywords

Comments

As a number triangle, this is given by T(n,k)=sum{j=0..n, C(n,j)(-1)^(n-j)sum{i=0..j, C(j+k,i-k)}}. - Paul Barry, Aug 23 2004
As a number triangle, this is the Riordan array (1/(1-x), x(1+x)) with T(n,k)=sum{i=0..n, binomial(k,i-k)}. Diagonal sums are then A023434(n+1). - Paul Barry, Feb 16 2005
Form partial sums across rows of square array of binomial coefficients A026729; see also A008949. - Philippe Deléham, Aug 28 2005
Square array A026729 -> Partial sums across rows
1 0 0 0 0 0 0 . . . . 1 1 1 1 1 1 1 . . . . . .
1 1 0 0 0 0 0 . . . . 1 2 2 2 2 2 2 . . . . . .
1 2 1 0 0 0 0 . . . . 1 3 4 4 4 4 4 . . . . . .
1 3 3 1 0 0 0 . . . . 1 4 7 8 8 8 8 . . . . . .
For other Whitney numbers see A007799.
W(n,k) is the number of length k binary sequences containing no more than n 1's. - Geoffrey Critzer, Mar 15 2010
From Emeric Deutsch, Jun 15 2010: (Start)
Viewed as a number triangle, T(n,k) is the number of internal nodes of the Fibonacci tree of order n+2 at level k. A Fibonacci tree of order n (n>=2) is a complete binary tree whose left subtree is the Fibonacci tree of order n-1 and whose right subtree is the Fibonacci tree of order n-2; each of the Fibonacci trees of order 0 and 1 is defined as a single node.
(End)
Named after the American mathematician Hassler Whitney (1907-1989). - Amiram Eldar, Jun 13 2021

Examples

			Table W(n,k) begins:
  1 1 1 1  1  1  1 ...
  1 2 3 4  5  6  7 ...
  1 2 4 7 11 16 22 ...
  1 2 4 8 15 26 42 ...
W(2,4) = 11 because there are 11 length 4 binary sequences containing no more than 2 1's: {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {0, 1, 0, 0}, {0, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 1, 0, 0}. - _Geoffrey Critzer_, Mar 15 2010
Table T(n, k) begins:
  1
  1  1
  1  2  1
  1  2  3  1
  1  2  4  4  1
  1  2  4  7  5  1
  1  2  4  8 11  6  1
...
		

References

  • Donald E. Knuth, The Art of Computer Programming, Vol. 3, 2nd edition, Addison-Wesley, Reading, MA, 1998, p. 417.

Crossrefs

Cf. A007799. As a triangle, mirror A052509.
Rows converge to powers of two (A000079). Subdiagonals include A000225, A000295, A002662, A002663, A002664, A035038, A035039, A035040, A035041, A035042. Antidiagonal sums are A000071.

Programs

  • Mathematica
    Transpose[ Table[Table[Sum[Binomial[n, k], {k, 0, m}], {m, 0, 15}], {n, 0, 15}]] // Grid (* Geoffrey Critzer, Mar 15 2010 *)
    T[ n_, k_] := Sum[ Binomial[n, j] (-1)^(n - j) Sum[ Binomial[j + k, i - k], {i, 0, j}], {j, 0, n}]; (* Michael Somos, May 31 2016 *)
  • PARI
    /* array read by antidiagonals up coordinate index functions */
    t1(n) = binomial(floor(3/2 + sqrt(2+2*n)), 2) - (n+1); /* A025581 */
    t2(n) = n - binomial(floor(1/2 + sqrt(2+2*n)), 2); /* A002262 */
    /* define the sequence array function for A004070 */
    W(n, k) = sum(i=0, n, binomial(k, i));
    /* visual check ( origin 0,0 ) */
    printp(matrix(7, 7, n, k, W(n-1, k-1)));
    /* print the sequence entries by antidiagonals going up ( origin 0,0 ) */
    print1("S A004070 "); for(n=0, 32, print1(W(t1(n), t2(n))","));
    print1("T A004070 "); for(n=33, 61, print1(W(t1(n), t2(n))","));
    print1("U A004070 "); for(n=62, 86, print1(W(t1(n), t2(n))",")); /* Michael Somos, Apr 28 2000 */
    
  • PARI
    T(n, k)=sum(m=0, n-k, binomial(k, m)) \\ Jianing Song, May 30 2022

Formula

W(n, k) = Sum_{i=0..n} binomial(k, i). - Bill Gosper
W(n, k) = if k=0 or n=0 then 1 else W(n, k-1)+W(n-1, k-1). - David Broadhurst, Jan 05 2000
The table W(n,k) = A000012 * A007318(transform), where A000012 = (1; 1,1; 1,1,1; ...). - Gary W. Adamson, Nov 15 2007
E.g.f. for row n: (1 + x + x^2/2! + ... + x^n/n!)* exp(x). - Geoffrey Critzer, Mar 15 2010
G.f.: 1 / (1 - x - x*y*(1 - x^2)) = Sum_{0 <= k <= n} x^n * y^k * T(n, k). - Michael Somos, May 31 2016
W(n, n) = 2^n. - Michael Somos, May 31 2016
From Jianing Song, May 30 2022: (Start)
T(n, 0) = T(n, n) = 1 for n >= 0; T(n, k) = T(n-1, k-1) + T(n-2, k-1) for k=1, 2, ..., n-1, n >= 2.
T(n, k) = Sum_{m=0..n-k} binomial(k, m).
T(n,k) = 2^k for 0 <= k <= floor(n/2). (End)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 20 2000

A002663 a(n) = 2^n - C(n,0) - C(n,1) - C(n,2) - C(n,3).

Original entry on oeis.org

0, 0, 0, 0, 1, 6, 22, 64, 163, 382, 848, 1816, 3797, 7814, 15914, 32192, 64839, 130238, 261156, 523128, 1047225, 2095590, 4192510, 8386560, 16774891, 33551806, 67105912, 134214424, 268431773, 536866822, 1073737298
Offset: 0

Views

Author

Keywords

Comments

Starting with "1" = eigensequence of a triangle with bin(n,4), A000332 as the left border: (1, 5, 15, 35, 70, ...) and the rest 1's. - Gary W. Adamson, Jul 24 2010
The Kn25 sums, see A180662, of triangle A065941 equal the terms (doubled) of this sequence minus the four leading zeros. - Johannes W. Meijer, Aug 14 2011
(1 + 6x + 22x^2 + 64x^3 + ...) = (1 + 3x + 6x^2 + 10x^3 + ...) * (1 + 3x + 7x^2 + 15x^3 + ...). - Gary W. Adamson, Mar 14 2012
The sequence starting (1, 6, 22, ...) is the binomial transform of A171418 and starting (0, 0, 0, 1, 6, 22, ...) is the binomial transform of (0, 0, 0, 1, 2, 2, 2, 2, 2, ...). - Gary W. Adamson, Jul 27 2015
Number of binary sequences with at least four 0's. - Enrique Navarrete, Jul 23 2025

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n)= A055248(n, 4). Partial sums of A002662.

Programs

  • Haskell
    a002663 n = a002663_list !! n
    a002663_list = map (sum . drop 4) a007318_tabl
    -- Reinhard Zumkeller, Jun 20 2015
    
  • Magma
    [2^n - Binomial(n,0)- Binomial(n,1) - Binomial(n,2) - Binomial(n,3): n in [0..35]]; // Vincenzo Librandi, May 20 2011
    
  • Maple
    A002663 := proc(n): 2^n - add(binomial(n,k),k=0..3) end: seq(A002663(n), n=0..30); # Johannes W. Meijer, Aug 14 2011
  • Mathematica
    a=1;lst={};s1=s2=s3=s4=0;Do[s1+=a;s2+=s1;s3+=s2;s4+=s3;AppendTo[lst,s4];a=a*2,{n,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 10 2009 *)
    Table[Sum[ Binomial[n + 4, k + 4], {k, 0, n}], {n, -4, 26}] (* Zerinvary Lajos, Jul 08 2009 *)
  • PARI
    a(n)=(6*2^n-n^3-5*n-6)/6 \\ Charles R Greathouse IV, Sep 24 2015

Formula

a(n) = 2^n - A000125(n).
G.f.: x^4/((1-2*x)*(1-x)^4). - Simon Plouffe in his 1992 dissertation
a(n) = Sum_{k=0..n} binomial(n,k+4) = Sum_{k=4..n} binomial(n,k). - Paul Barry, Aug 23 2004
a(n) = 2*a(n-1) + binomial(n-1,3). - Paul Barry, Aug 23 2004
a(n) = (6*2^n - n^3 - 5*n - 6)/6. - Mats Granvik, Gary W. Adamson, Feb 17 2010
From Enrique Navarrete, Jul 23 2025: (Start)
a(n) = 6*a(n-1) - 14*a(n-2) + 16*a(n-3) - 9*a(n-4) + 2*a(n-5).
E.g.f.: exp(x)*(exp(x) - 1 - x - x^2/2 - x^3/6). (End)

A052509 Knights-move Pascal triangle: T(n,k), n >= 0, 0 <= k <= n; T(n,0) = T(n,n) = 1, T(n,k) = T(n-1,k) + T(n-2,k-1) for k = 1,2,...,n-1, n >= 2.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 4, 2, 1, 1, 5, 7, 4, 2, 1, 1, 6, 11, 8, 4, 2, 1, 1, 7, 16, 15, 8, 4, 2, 1, 1, 8, 22, 26, 16, 8, 4, 2, 1, 1, 9, 29, 42, 31, 16, 8, 4, 2, 1, 1, 10, 37, 64, 57, 32, 16, 8, 4, 2, 1, 1, 11, 46, 93, 99, 63, 32, 16, 8, 4, 2, 1
Offset: 0

Views

Author

N. J. A. Sloane, Mar 17 2000

Keywords

Comments

Also square array T(n,k) (n >= 0, k >= 0) read by antidiagonals: T(n,k) = Sum_{i=0..k} binomial(n,i).
As a number triangle read by rows, this is T(n,k) = Sum_{i=n-2*k..n-k} binomial(n-k,i), with T(n,k) = T(n-1,k) + T(n-2,k-1). Row sums are A000071(n+2). Diagonal sums are A023435(n+1). It is the reverse of the Whitney triangle A004070. - Paul Barry, Sep 04 2005
Also, twice number of orthants intersected by a generic k-dimensional subspace of R^n [Naiman and Scheinerman, 2017]. - N. J. A. Sloane, Mar 03 2018

Examples

			Triangle begins:
[0] 1;
[1] 1, 1;
[2] 1, 2,  1;
[3] 1, 3,  2,  1;
[4] 1, 4,  4,  2,  1;
[5] 1, 5,  7,  4,  2,  1;
[6] 1, 6, 11,  8,  4,  2, 1;
[7] 1, 7, 16, 15,  8,  4, 2, 1;
[8] 1, 8, 22, 26, 16,  8, 4, 2, 1;
[9] 1, 9, 29, 42, 31, 16, 8, 4, 2, 1;
As a square array, this begins:
  1  1  1  1  1  1 ...
  1  2  2  2  2  2 ...
  1  3  4  4  4  4 ...
  1  4  7  8  8  8 ...
  1  5 11 15 16 ...
  1  6 16 26 31 32 ...
		

Crossrefs

Row sums A000071; Diagonal sums A023435; Mirror A004070.
Columns give A000027, A000124, A000125, A000127, A006261, ...
Partial sums across rows of (extended) Pascal's triangle A052553.

Programs

  • GAP
    A052509:=Flat(List([0..100],n->List([0..n],k->Sum([0..n],m->Binomial(n-k,k-m))))); # Muniru A Asiru, Sat Feb 17 2018
    
  • Haskell
    a052509 n k = a052509_tabl !! n !! k
    a052509_row n = a052509_tabl !! n
    a052509_tabl = [1] : [1,1] : f [1] [1,1] where
       f row' row = rs : f row rs where
         rs = zipWith (+) ([0] ++ row' ++ [1]) (row ++ [0])
    -- Reinhard Zumkeller, Nov 22 2012
    
  • Magma
    [[(&+[Binomial(n-k, k-j): j in [0..n]]): k in [0..n]]: n in [0..10]]; // G. C. Greubel, May 13 2019
    
  • Maple
    a := proc(n::nonnegint, k::nonnegint) option remember: if k=0 then RETURN(1) fi: if k=n then RETURN(1) fi: a(n-1,k)+a(n-2,k-1) end: for n from 0 to 11 do for k from 0 to n do printf(`%d,`,a(n,k)) od: od: # James Sellers, Mar 17 2000
    with(combinat): for s from 0 to 11 do for n from s to 0 by -1 do if n=0 or s-n=0 then printf(`%d,`,1) else printf(`%d,`,sum(binomial(n, i), i=0..s-n)) fi; od: od: # James Sellers, Mar 17 2000
  • Mathematica
    Table[Sum[Binomial[n-k, k-m], {m, 0, n}], {n, 0, 10}, {k, 0, n}]
    T[n_, k_] := Hypergeometric2F1[-k, -n + k, -k, -1];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Peter Luschny, Nov 28 2021 *)
  • PARI
    T(n,k)=sum(m=0,n,binomial(n-k,k-m));
    for(n=0,10,for(k=0,n,print1(T(n,k),", "););print();); /* show triangle */
    
  • Sage
    [[sum(binomial(n-k, k-j) for j in (0..n)) for k in (0..n)] for n in (0..10)] # G. C. Greubel, May 13 2019

Formula

T(n, k) = Sum_{m=0..n} binomial(n-k, k-m). - Wouter Meeussen, Oct 03 2002
From Werner Schulte, Feb 15 2018: (Start)
Referring to the square array T(i,j):
G.f. of row n: Sum_{k>=0} T(n,k) * x^k = (1+x)^n / (1-x).
G.f. of T(i,j): Sum_{k>=0, n>=0} T(n,k) * x^k * y^n = 1 / ((1-x)*(1-y-x*y)).
Let a_i(n) be multiplicative with a_i(p^e) = T(i, e), p prime and e >= 0, then Sum_{n>0} a_i(n)/n^s = (zeta(s))^(i+1) / (zeta(2*s))^i for i >= 0.
(End)
T(n, k) = hypergeom([-k, -n + k], [-k], -1). - Peter Luschny, Nov 28 2021
From Jianing Song, May 30 2022: (Start)
Referring to the triangle, G.f.: Sum_{n>=0, 0<=k<=n} T(n,k) * x^n * y^k = 1 / ((1-x*y)*(1-x-x^2*y)).
T(n,k) = 2^(n-k) for ceiling(n/2) <= k <= n. (End)

Extensions

More terms from James Sellers, Mar 17 2000
Entry formed by merging two earlier entries. - N. J. A. Sloane, Jun 17 2007
Edited by Johannes W. Meijer, Jul 24 2011
Previous Showing 11-20 of 80 results. Next