cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A002817 Doubly triangular numbers: a(n) = n*(n+1)*(n^2+n+2)/8.

Original entry on oeis.org

0, 1, 6, 21, 55, 120, 231, 406, 666, 1035, 1540, 2211, 3081, 4186, 5565, 7260, 9316, 11781, 14706, 18145, 22155, 26796, 32131, 38226, 45150, 52975, 61776, 71631, 82621, 94830, 108345, 123256, 139656, 157641, 177310, 198765, 222111, 247456, 274911, 304590
Offset: 0

Views

Author

Keywords

Comments

Number of inequivalent ways to color vertices of a square using <= n colors, allowing rotations and reflections. Group is dihedral group D_8 of order 8 with cycle index (1/8)*(x1^4 + 2*x4 + 3*x2^2 + 2*x1^2*x2); setting all x_i = n gives the formula a(n) = (1/8)*(n^4 + 2*n + 3*n^2 + 2*n^3).
Number of semi-magic 3 X 3 squares with a line sum of n-1. That is, 3 X 3 matrices of nonnegative integers such that row sums and column sums are all equal to n-1. - [Gupta, 1968, page 653; Bell, 1970, page 279]. - Peter Bertok (peter(AT)bertok.com), Jan 12 2002. See A005045 for another version.
Also the coefficient h_2 of x^{n-3} in the shelling polynomial h(x)=h_0*x^n-1 + h_1*x^n-2 + h_2*x^n-3 + ... + h_n-1 for the independence complex of the cycle matroid of the complete graph K_n on n vertices (n>=2) - Woong Kook (andrewk(AT)math.uri.edu), Nov 01 2006
If X is an n-set and Y a fixed 3-subset of X then a(n-4) is equal to the number of 5-subsets of X intersecting Y. - Milan Janjic, Jul 30 2007
Starting with offset 1 = binomial transform of [1, 5, 10, 9, 3, 0, 0, 0, ...]. - Gary W. Adamson, Aug 05 2009
Starting with "1" = row sums of triangle A178238. - Gary W. Adamson, May 23 2010
The equation n*(n+1)*(n^2 + n + 2)/8 may be arrived at by solving for x in the following equality: (n^2+n)/2 = (sqrt(8x+1)-1)/2. - William A. Tedeschi, Aug 18 2010
Partial sums of A006003. - Jeremy Gardiner, Jun 23 2013
Doubly triangular numbers are revealed in the sums of row sums of Floyd's triangle.
1, 1+5, 1+5+15, ...
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
- Tony Foster III, Nov 14 2015
From Jaroslav Krizek, Mar 04 2017: (Start)
For n>=1; a(n) = sum of the different sums of elements of all the nonempty subsets of the sets of numbers from 1 to n.
Example: for n = 6; nonempty subsets of the set of numbers from 1 to 3: {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}; sums of elements of these subsets: 1, 2, 3, 3, 4, 5, 6; different sums of elements of these subsets: 1, 2, 3, 4, 5, 6; a(3) = (1+2+3+4+5+6) = 21, ... (End)
a(n) is also the number of 4-cycles in the (n+4)-path complement graph. - Eric W. Weisstein, Apr 11 2018

Examples

			G.f. = x + 6*x^2 + 21*x^3 + 55*x^4 + 120*x^5 + 231*x^6 + 406*x^7 + 666*x^8 + ...
		

References

  • A. Björner, The homology and shellability of matroids and geometric lattices, in Matroid Applications (ed. N. White), Encyclopedia of Mathematics and Its Applications, 40, Cambridge Univ. Press 1992.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 124, #25, Q(3,r).
  • 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).
  • R. P. Stanley, Enumerative Combinatorics I, p. 292.

Crossrefs

Cf. A006003 (first differences), A165211 (mod 2).
Multiple triangular: A000217, A064322, A066370.
Cf. A006528 (square colorings).
Cf. A236770 (see crossrefs).
Row n=3 of A257493 and row n=2 of A331436 and A343097.
Cf. A000332.
Cf. A000292 (3-cycle count of \bar P_{n+4}), A060446 (5-cycle count of \bar P_{n+3}), A302695 (6-cycle count of \bar P_{n+5}).

Programs

  • Maple
    A002817 := n->n*(n+1)*(n^2+n+2)/8;
  • Mathematica
    a[ n_] := n (n + 1) (n^2 + n + 2) / 8; (* Michael Somos, Jul 24 2002 *)
    LinearRecurrence[{5,-10,10,-5,1}, {0,1,6,21,55},40] (* Harvey P. Dale, Jul 18 2011 *)
    nn=50;Join[{0},With[{c=(n(n+1))/2},Flatten[Table[Take[Accumulate[Range[ (nn(nn+1))/2]], {c,c}],{n,nn}]]]] (* Harvey P. Dale, Mar 19 2013 *)
  • PARI
    {a(n) = n * (n+1) * (n^2 + n + 2) / 8}; /* Michael Somos, Jul 24 2002 */
    
  • PARI
    concat(0, Vec(x*(1+x+x^2)/(1-x)^5 + O(x^50))) \\ Altug Alkan, Nov 15 2015
    
  • Python
    def A002817(n): return (m:=n*(n+1))*(m+2)>>3 # Chai Wah Wu, Aug 30 2024

Formula

a(n) = 3*binomial(n+2, 4) + binomial(n+1, 2).
G.f.: x*(1 + x + x^2)/(1-x)^5. - Simon Plouffe (in his 1992 dissertation); edited by N. J. A. Sloane, May 13 2008
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) + 3. - Warut Roonguthai, Dec 13 1999
a(n) = 5a(n-1) - 10a(n-2) + 10a(n-3) - 5a(n-4) + a(n-5) = A000217(A000217(n)). - Ant King, Nov 18 2010
a(n) = Sum(Sum(1 + Sum(3*n))). - Xavier Acloque, Jan 21 2003
a(n) = A000332(n+1) + A000332(n+2) + A000332(n+3), with A000332(n) = binomial(n, 4). - Mitch Harris, Oct 17 2006 and Bruce J. Nicholson, Oct 22 2017
a(n) = Sum_{i=1..C(n,2)} i = C(C(n,2) + 1, 2) = A000217(A000217(n+1)). - Enrique Pérez Herrero, Jun 11 2012
Euler transform of length 3 sequence [6, 0, -1]. - Michael Somos, Nov 19 2015
E.g.f.: x*(8 + 16*x + 8*x^2 + x^3)*exp(x)/8. - Ilya Gutkovskiy, Apr 26 2016
Sum_{n>=1} 1/a(n) = 6 - 4*Pi*tanh(sqrt(7)*Pi/2)/sqrt(7) = 1.25269064911978447... . - Vaclav Kotesovec, Apr 27 2016
a(n) = A000217(n)*A000124(n)/2.
a(n) = ((n-1)^4 + 3*(n-1)^3 + 2*(n-1)^2 + 2*n))/8. - Bruce J. Nicholson, Apr 05 2017
a(n) = (A016754(n)+ A007204(n)- 2) / 32. - Bruce J. Nicholson, Apr 14 2017
a(n) = a(-1-n) for all n in Z. - Michael Somos, Apr 17 2017
a(n) = T(T(n)) where T are the triangular numbers A000217. - Albert Renshaw, Jan 05 2020
a(n) = 2*n^2 - n + 6*binomial(n, 3) + 3*binomial(n, 4). - Ryan Jean, Mar 20 2021
a(n) = (A008514(n) - 1)/16. - Charlie Marion, Dec 20 2024

Extensions

More terms from Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 29 1999

A034262 a(n) = n^3 + n.

Original entry on oeis.org

0, 2, 10, 30, 68, 130, 222, 350, 520, 738, 1010, 1342, 1740, 2210, 2758, 3390, 4112, 4930, 5850, 6878, 8020, 9282, 10670, 12190, 13848, 15650, 17602, 19710, 21980, 24418, 27030, 29822, 32800, 35970, 39338, 42910, 46692, 50690, 54910, 59358, 64040, 68962, 74130
Offset: 0

Views

Author

Stuart M. Ellerstein (ellerstein(AT)aol.com), Apr 21 2000

Keywords

Comments

k such that x^3 + x + k factors over the integers. - James R. Buddenhagen, Apr 19 2005
If a(n)=X [A155977], Y=b(n) [A071253], Z=c(n) [A034262], then X^2+Y^2 = n*Z^3; e.g., if n=3, a(3)=270, b(3)=90, c(3)=30, then 270^2+90^2=3*30^3. - Vincenzo Librandi, Nov 24 2010
From Bruno Berselli, Sep 06 2018: (Start)
After 0, sum of next n even numbers:
... 2, 2
... 4, 6, 10
... 8, 10, 12, 30
.. 14, 16, 18, 20, 68
.. 22, 24, 26, 28, 30, 130
.. 32, 34, 36, 38, 40, 42, 222 etc. (End)
Sequence occurs in the binomial identity Sum_{k = 0..n} a(k)* binomial(n,k)/binomial(n+k,k) = n*(n + 1)/2. Cf. A092181 and A155977. - Peter Bala, Feb 12 2019
For n >= 2, a(n) is the sum of the numbers in the 1st and last columns of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows. - Wesley Ivan Hurt, May 17 2021

Crossrefs

Programs

Formula

a(n) = 2*A006003(n).
a(n) = A002522(n)*A001477(n). - Zerinvary Lajos, Apr 20 2008
For n>1, a(n) = floor(n^5/(n^2-1)). - Gary Detlefs, Feb 10 2010
Sum_{n>=1} 1/a(n) = 0.6718659855... = gamma + Re psi(1+i) = A001620+A248177. [Borwein et al., J. Math. Anal. Appl. 316 (2006) 328]. - R. J. Mathar, Jul 17 2012
a(n) = -a(-n) for all n in Z. - Michael Somos, Jul 11 2017
G.f.: 2*x*(x^2+x+1)/(x-1)^4. - Alois P. Heinz, Oct 08 2022
E.g.f.: x*(2 + 3*x + x^2)*exp(x). - Stefano Spezia, Jun 20 2024

A103881 Square array T(n,k) (n >= 1, k >= 0) read by antidiagonals: coordination sequence for root lattice A_n.

Original entry on oeis.org

1, 1, 2, 1, 6, 2, 1, 12, 12, 2, 1, 20, 42, 18, 2, 1, 30, 110, 92, 24, 2, 1, 42, 240, 340, 162, 30, 2, 1, 56, 462, 1010, 780, 252, 36, 2, 1, 72, 812, 2562, 2970, 1500, 362, 42, 2, 1, 90, 1332, 5768, 9492, 7002, 2570, 492, 48, 2, 1, 110, 2070, 11832, 26474, 27174, 14240, 4060, 642, 54, 2, 1, 132, 3080, 22530, 66222, 91112, 65226, 26070, 6040, 812, 60, 2
Offset: 1

Views

Author

Ralf Stephan, Feb 20 2005

Keywords

Comments

T(n,k) is the number of integer sequences of length n+1 with sum zero and sum of absolute values 2k. - R. H. Hardin, Feb 23 2009

Examples

			Array begins:
  1,   2,     2,      2,       2,        2,         2,          2, ... A040000;
  1,   6,    12,     18,      24,       30,        36,         42, ... A008458;
  1,  12,    42,     92,     162,      252,       362,        492, ... A005901;
  1,  20,   110,    340,     780,     1500,      2570,       4060, ... A008383;
  1,  30,   240,   1010,    2970,     7002,     14240,      26070, ... A008385;
  1,  42,   462,   2562,    9492,    27174,     65226,     137886, ... A008387;
  1,  56,   812,   5768,   26474,    91112,    256508,     623576, ... A008389;
  1,  72,  1332,  11832,   66222,   271224,    889716,    2476296, ... A008391;
  1,  90,  2070,  22530,  151560,   731502,   2777370,    8809110, ... A008393;
  1, 110,  3080,  40370,  322190,  1815506,   7925720,   28512110, ... A008395;
  1, 132,  4422,  68772,  643632,  4197468,  20934474,   85014204, ... A035837;
  1, 156,  6162, 112268, 1219374,  9129276,  51697802,  235895244, ... A035838;
  1, 182,  8372, 176722, 2206932, 18827718, 120353324,  614266354, ... A035839;
  1, 210, 11130, 269570, 3838590, 37060506, 265953170, 1511679210, ... A035840;
  ...
Antidiagonals:
  1;
  1,  2;
  1,  6,    2;
  1, 12,   12,    2;
  1, 20,   42,   18,    2;
  1, 30,  110,   92,   24,    2;
  1, 42,  240,  340,  162,   30,    2;
  1, 56,  462, 1010,  780,  252,   36,   2;
  1, 72,  812, 2562, 2970, 1500,  362,  42,  2;
  1, 90, 1332, 5768, 9492, 7002, 2570, 492, 48,  2;
		

Crossrefs

Programs

  • GAP
    T:=Flat(List([1..12],n->Concatenation([1],List([1..n-1],k->Sum([1..n],i->Binomial(n-k+1,i)*Binomial(k-1,i-1)*Binomial(n-i,k)))))); # Muniru A Asiru, Oct 14 2018
    
  • Magma
    A103881:= func< n,k | k le 0 select 1 else (&+[Binomial(n-k+1, j)*Binomial(k-1, j-1)*Binomial(n-j, k): j in [1..n-k]]) >;
    [A103881(n,k): k in [0..n-1], n in [1..15]]; // G. C. Greubel, Oct 16 2018; May 24 2023
    
  • Maple
    T:=proc(n,k) option remember; local i;
    if k=0 then 1 else
    add( binomial(n+1,i)*binomial(k-1,i-1)*binomial(n-i+k,k),i=1..n); fi;
    end:
    g:=n->[seq(T(n-i,i),i=0..n-1)]:
    for n from 1 to 14 do lprint(op(g(n))); od:
  • Mathematica
    T[n_, k_]:= (n+1)*(n+k-1)!*HypergeometricPFQ[{1-k,1-n,-n}, {2,-n-k+1}, 1]/(k!*(n-1)!); T[, 0]=1; Flatten[Table[T[n-k, k], {n,12}, {k,0,n-1}]] (* _Jean-François Alcover, Dec 27 2012 *)
  • PARI
    A103881(n,k) = if(k==0, 1, sum(j=1, n-k, binomial(n-k+1, j)*binomial(k-1, j-1)*binomial(n-j, k)));
    for(n=1, 15, for(k=0, n-1, print1(A103881(n,k), ", "))) \\ G. C. Greubel, Oct 16 2018; May 24 2023
    
  • SageMath
    def A103881(n,k): return 1 if k==0 else (n-k+1)*binomial(n-1,k)*hypergeometric([k-n,1+k-n,1-k], [2,1-n], 1).simplify()
    flatten([[A103881(n,k) for k in range(n)] for n in range(1,16)]) # G. C. Greubel, May 24 2023

Formula

T(n,k) = Sum_{i=1..n} C(n+1, i)*C(k-1, i-1)*C(n-i+k, k), T(n,0)=1.
G.f. of n-th row: (Sum_{i=0..n} C(n, i)^2*x^i)/(1-x)^n.
From G. C. Greubel, May 24 2023: (Start)
T(n, k) = Sum_{j=0..n} binomial(n,j)^2 * binomial(n+k-j-1, n-1) (array).
T(n, k) = (n+1)*binomial(n+k-1,k)*hypergeometric([-n,1-n,1-k], [2,1-n-k], 1), with T(n, k) = 1 (array).
t(n, k) = (n-k+1)*binomial(n-1,k)*hypergeometric([k-n,1+k-n,1-k], [2,1-n], 1), with t(n, 0) = 1 (antidiagonals).
Sum_{k=0..n-1} t(n, k) = A047085(n). (End)
From Peter Bala, Jul 09 2023: (Start)
T(n,k) = [x^k] Legendre_P(n, (1 + x)/(1 - x)).
(n+1)*T(n+1,k) = (n+1)*T(n+1,k-1) + (2*n+1)*(T(n,k) + T(n,k-1)) - n*(T(n-1,k) - T(n-1,k-1)). (End)

Extensions

Corrected by N. J. A. Sloane, Dec 15 2012, at the suggestion of Manuel Blum

A189073 Triangle read by rows: T(n,k) is the number of inversions in k-compositions of n for n >= 3, 2 <= k <= n-1.

Original entry on oeis.org

1, 1, 3, 2, 6, 6, 2, 12, 18, 10, 3, 18, 42, 40, 15, 3, 27, 78, 110, 75, 21, 4, 36, 132, 240, 240, 126, 28, 4, 48, 204, 460, 600, 462, 196, 36, 5, 60, 300, 800, 1290, 1302, 812, 288, 45, 5, 75, 420, 1300, 2490, 3108, 2548, 1332, 405, 55, 6, 90, 570, 2000, 4440, 6594, 6692, 4608, 2070, 550, 66
Offset: 3

Views

Author

N. J. A. Sloane, Apr 16 2011

Keywords

Comments

The Heibach et al. reference has a table for n <= 14.

Examples

			Triangle begins:
1;
1,  3;
2,  6,   6;
2, 12,  18,   10;
3, 18,  42,   40,   15;
3, 27,  78,  110,   75,   21;
4, 36, 132,  240,  240,  126,   28;
4, 48, 204,  460,  600,  462,  196,   36;
5, 60, 300,  800, 1290, 1302,  812,  288,   45;
5, 75, 420, 1300, 2490, 3108, 2548, 1332,  405,  55;
6, 90, 570, 2000, 4440, 6594, 6692, 4608, 2070, 550, 66;
...
T(5,3) = 6 because we have: 3+1+1, 1+3+1, 1+1+3, 2+2+1, 2+1+2, 1+2+2 having 2,1,0,2,1,0 inversions respectively. - _Geoffrey Critzer_, Mar 19 2014
		

Crossrefs

Row sums are A189052. The first column is A004526(n-1). Diagonal is A000217(n-2). Lower diagonal is A002411(n-3). 2nd lower diagonal is A001621(n-4).

Programs

  • Maple
    T:= proc(n, k) option remember;
          if k=2 then floor((n-1)/2)
        elif k>=n then 0
        else T(n-1, k) +k/(k-2) *T(n-1, k-1)
          fi
        end:
    seq(seq(T(n, k), k=2..n-1), n=3..13);  # Alois P. Heinz, Apr 17 2011
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 2, Floor[(n-1)/2], k >= n, 0, True, T[n-1, k] + k/(k-2)*T[n-1, k-1]]; Table[Table[T[n, k], {k, 2, n-1}], {n, 3, 13}] // Flatten (* Jean-François Alcover, Jan 14 2014, after Alois P. Heinz *)

Formula

G.f.: (1-x)*x^3/((1+x)*(1-x-y*x)^3). - Geoffrey Critzer, Mar 19 2014
Showing 1-4 of 4 results.