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-3 of 3 results.

A019298 Number of balls in pyramid with base either a regular hexagon or a hexagon with alternate sides differing by 1 (balls in hexagonal pyramid of height n taken from hexagonal close-packing).

Original entry on oeis.org

0, 1, 4, 11, 23, 42, 69, 106, 154, 215, 290, 381, 489, 616, 763, 932, 1124, 1341, 1584, 1855, 2155, 2486, 2849, 3246, 3678, 4147, 4654, 5201, 5789, 6420, 7095, 7816, 8584, 9401, 10268, 11187, 12159, 13186
Offset: 0

Views

Author

Eric E Blom (eblom(AT)REM.re.uokhsc.edu)

Keywords

Comments

Alternately add and subtract successively longer sets of integers: 0; 1 = 0+1; -4 = 1-2-3; 11 = -4+4+5+6; -23 = 11-7-8-9-10; 42 = -23+11+12+13+14+15; -69 = 42-16-17-18-19-20-21; ... then take absolute values. - Walter Carlini, Aug 28 2003
Number of 3 X 3 symmetric matrices with nonnegative integer entries, such that every row (and column) sum equals n-1.
Equals Sum_{0..n} of "three-quarter squares" sequence (A077043). - Philipp M. Buluschek (kitschen(AT)romandie.com), Aug 12 2007
a(n) is the sum of the n-th row in A220075, n > 0. - Reinhard Zumkeller, Dec 03 2012
Sum of all the smallest parts in the partitions of 3n into three parts (see example). - Wesley Ivan Hurt, Jan 23 2014
For n > 0, a(n) is the number of (nonnegative integer) magic labelings of the prism graph Y_3 with magic sum n - 1. - L. Edson Jeffery, Sep 09 2017
Or number of magic labelings of LOOP X C_3 with magic sum n - 1, where LOOP is the 1-vertex, 1-loop-edge graph, as Y_k = I X C_k and LOOP X C_k have the same numbers of magic labelings when k is odd. - David J. Seal, Sep 13 2017
a(n) is the number of triples of integers in [1,n]^3 such that each pair has sum larger than n. - Bob Zwetsloot, Jul 23 2020

Examples

			Add last column for a(n) (n > 0).
                                               13 + 1 + 1
                                               12 + 2 + 1
                                               11 + 3 + 1
                                               10 + 4 + 1
                                                9 + 5 + 1
                                                8 + 6 + 1
                                                7 + 7 + 1
                                   10 + 1 + 1  11 + 2 + 2
                                    9 + 2 + 1  10 + 3 + 2
                                    8 + 3 + 1   9 + 4 + 2
                                    7 + 4 + 1   8 + 5 + 2
                                    6 + 5 + 1   7 + 6 + 2
                        7 + 1 + 1   8 + 2 + 2   9 + 3 + 3
                        6 + 2 + 1   7 + 3 + 2   8 + 4 + 3
                        5 + 3 + 1   6 + 4 + 2   7 + 5 + 3
                        4 + 4 + 1   5 + 5 + 2   6 + 6 + 3
            4 + 1 + 1   5 + 2 + 2   6 + 3 + 3   7 + 4 + 4
            3 + 2 + 1   4 + 3 + 2   5 + 4 + 3   6 + 5 + 4
1 + 1 + 1   2 + 2 + 2   3 + 3 + 3   4 + 4 + 4   5 + 5 + 5
   3(1)        3(2)        3(3)        3(4)        3(5)     ..   3n
---------------------------------------------------------------------
    1           4           11          23          42      ..  a(n)
		

References

  • R. P. Stanley, Enumerative Combinatorics, Wadsworth, Vol. 1, 1986; see Prop. 4.6.21, p. 235, G_3(lambda).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.14(a), p. 452.

Crossrefs

Cf. A053493, A077043 (first differences), A002717.
Cf. A061927, A244497, A292281, A244873, A289992 (# of magic labelings of prism graph Y_k = I X C_k, for k = 4,5,6,7,8, up to an offset).
Cf. A006325, A244879, A244880 (# of magic labelings of LOOP X C_k, for k = 4,6,8, up to an offset).

Programs

  • Magma
    [Floor((n^2+1)*(2*n+3)/8): n in [0..80]]; // Vincenzo Librandi, Jul 28 2013
    
  • Maple
    series(x*(x^2+x+1)/(x+1)/(x-1)^4,x,80);
  • Mathematica
    Table[ Ceiling[3*n^2/4], {n, 0, 37}] // Accumulate (* Jean-François Alcover, Dec 20 2012, after Philipp M. Buluschek's comment *)
    CoefficientList[Series[x (x^2 + x + 1) / ((x + 1) (x - 1)^4), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 28 2013 *)
    LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 4, 11, 23}, 38] (* L. Edson Jeffery, Sep 09 2017 *)
  • PARI
    a(n)=(n^2+1)*(2*n+3)\8 \\ Charles R Greathouse IV, Apr 04 2013
    
  • Python
    def A019298(n): return n*(n*(2*n+3)+2)+3>>3 # Chai Wah Wu, Jun 07 2025

Formula

a(n) = floor((n^2+1)(2n+3)/8).
G.f.: x*(x^2+x+1)/((x+1)*(x-1)^4).
a(n) = floor((2n^3 + 3n^2 + 2n)/8); also nearest integer to ((n+1)^4 - n^4)/16.
a(n) = (4n^3 + 6n^2 + 4n+1 - (-1)^n)/16. - Wesley Petty (Wesley.Petty(AT)mail.tamucc.edu), Mar 06 2004
a(n) = Sum_{i=1..n} i^2 - floor(i^2/4) = Sum_{i=1..n} i * (2n - 2i + 1 - floor((n - i + 1)/2) ). - Wesley Ivan Hurt, Jan 23 2014
E.g.f.: (1/16)*(-exp(-x) + exp(x)*(1 + 14*x + 18*x^2 + 4*x^3)). - Stefano Spezia, Nov 29 2019
a(2*n) = (1/2)*( n*(n + 1)^3 - (n - 1)*n^3 ); a(2*n-1) = (1/2)*( (n + 1)*n^3 - n*(n - 1)^3 ) (note: replacing the exponent 3 with 2 throughout gives the sequence of generalized pentagonal numbers A001318). - Peter Bala, Aug 11 2021
a(2n-1) = A213772(n). - R. J. Mathar, Mar 02 2025
(n-2)*a(n) -3*a(n-1) -(n+1)*a(n-2) +2*n-1 =0. - R. J. Mathar, Mar 09 2025

Extensions

Error in n=8 term corrected May 15 1997

A220073 Mirror of the triangle A130517.

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 3, 1, 2, 4, 4, 2, 1, 3, 5, 5, 3, 1, 2, 4, 6, 6, 4, 2, 1, 3, 5, 7, 7, 5, 3, 1, 2, 4, 6, 8, 8, 6, 4, 2, 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 10, 8, 6, 4, 2, 1, 3, 5, 7, 9, 11, 11, 9, 7, 5, 3, 1, 2, 4, 6, 8, 10, 12, 12, 10, 8, 6, 4, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 03 2012

Keywords

Comments

T(n,k) = A130517(n,n-k+1), 1 <= k <= n;
T(n,n) = T(n,1) + 1.
From Boris Putievskiy, Jan 15 2013: (Start)
General case see A187760. Let m be natural number. Table T(n,k) n, k > 0, T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+m-1, if n < k. Table T(n,k) read by antidiagonals. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m} shifts the sequence A000027. For m=1 the result is A220073, for m=2 the result is A143182. (End)
First inverse function (numbers of rows) for pairing function A209293. - Boris Putievskiy, Jan 28 2013

Examples

			From _Boris Putievskiy_, Jan 15 2013: (Start)
The start of the sequence as table:
1..1..2..3..4..5..6..7...
2..1..1..2..3..4..5..6...
3..2..1..1..2..3..4..5...
4..3..2..1..1..2..3..4...
5..4..3..2..1..1..2..3...
6..5..4..3..2..1..1..2...
7..6..5..4..3..2..1..1...
8..7..6..5..4..3..2..1...
. . .
The start of the sequence as triangle array read by rows:
1,
1, 2,
2, 1, 3,
3, 1, 2, 4,
4, 2, 1, 3, 5,
5, 3, 1, 2, 4, 6,
6, 4, 2, 1, 3, 5, 7,
7, 5, 3, 1, 2, 4, 6, 8,
. . .
Row number r contains r numbers: r-1, r-3,...,1,...r-2,r.
(End)
		

Crossrefs

Cf. A028310 (left edge), A000027 (right edge), A000012 (central terms), A000217 (row sums), A220075 (partial sums in rows), A002260, A000027, A143182, A187760, A209293.

Programs

  • Haskell
    a220073 n k = a220073_tabl !! (n-1) !! (k-1)
    a220073_row n = a220073_tabl !! (n-1)
    a220073_tabl = map reverse a130517_tabl
  • Mathematica
    max = 13;
    row[n_] := Join[Range[n, 1, -1], Range[max - n + 1]];
    T = Array[row, max];
    Table[T[[n - k + 1, k]], {n, 1, max}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Sep 11 2017 *)

Formula

T(1,1)=1, for n>1: T(n,k)=T(n-1,n-k+1), 1<=k
From Boris Putievskiy, Jan 15 2013: (Start)
For the general case
a(n) = |(t+1)^2 - 2n| + m*floor((t^2+3t+2-2n)/(t+1)),
where t = floor((-1+sqrt(8*n-7))/2).
For m = 2
a(n) = |(t+1)^2 - 2n| + floor((t^2+3t+2-2n)/(t+1)),
where t=floor((-1+sqrt(8*n-7))/2). (End)

A220053 Partial sums in rows of A130517, triangle read by rows.

Original entry on oeis.org

1, 2, 3, 3, 4, 6, 4, 6, 7, 10, 5, 8, 9, 11, 15, 6, 10, 12, 13, 16, 21, 7, 12, 15, 16, 18, 22, 28, 8, 14, 18, 20, 21, 24, 29, 36, 9, 16, 21, 24, 25, 27, 31, 37, 45, 10, 18, 24, 28, 30, 31, 34, 39, 46, 55, 11, 20, 27, 32, 35, 36, 38, 42, 48, 56, 66, 12, 22, 30
Offset: 1

Author

Reinhard Zumkeller, Dec 03 2012

Keywords

Examples

			1;
2, 3;
3, 4, 6;
4, 6, 7, 10;
5, 8, 9, 11, 15;
6, 10, 12, 13, 16, 21;
7, 12, 15, 16, 18, 22, 28;
8, 14, 18, 20, 21, 24, 29, 36;
9, 16, 21, 24, 25, 27, 31, 37, 45;
10, 18, 24, 28, 30, 31, 34, 39, 46, 55;
11, 20, 27, 32, 35, 36, 38, 42, 48, 56, 66;
		

Crossrefs

Cf. A000027 (left edge), A000217 (right edge), A000290 (central terms), A002717 (row sums); A220075.

Programs

  • Haskell
    a220053 n k = a220053_tabl !! (n-1) !! (k-1)
    a220053_row n = a220053_tabl !! (n-1)
    a220053_tabl = map (scanl1 (+)) a130517_tabl
    -- Reinhard Zumkeller, Dec 03 2012
  • Mathematica
    T[n_, 1] := n;
    T[n_, n_] := n-1;
    T[n_, k_] := Abs[2k - n - If[2k <= n+1, 2, 1]];
    row[n_] := Table[T[n, k], {k, 1, n}] // Accumulate;
    Table[row[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Sep 23 2021 *)

Formula

T(n,k) = Sum_{i=1..k} A130517(n, i).
Showing 1-3 of 3 results.