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

A128623 Triangle read by rows: A128621 * A000012 as infinite lower triangular matrices.

Original entry on oeis.org

1, 2, 2, 6, 3, 3, 8, 8, 4, 4, 15, 10, 10, 5, 5, 18, 18, 12, 12, 6, 6, 28, 21, 21, 14, 14, 7, 7, 32, 32, 24, 24, 16, 16, 8, 8, 45, 36, 36, 27, 27, 18, 18, 9, 9, 50, 50, 40, 40, 30, 30, 20, 20, 10, 10, 66, 55, 55, 44, 44, 33, 33, 22, 22, 11, 11, 72, 72, 60, 60, 48, 48, 36, 36, 24, 24, 12, 12, 91, 78, 78, 65, 65, 52, 52, 39, 39, 26, 26, 13, 13
Offset: 1

Views

Author

Gary W. Adamson, Mar 14 2007

Keywords

Examples

			First few rows of the triangle are:
   1;
   2,  2;
   6,  3,  3;
   8,  8,  4,  4;
  15, 10, 10,  5,  5;
  18, 18, 12, 12,  6, 6;
  28, 21, 21, 14, 14, 7, 7;
  ...
		

Crossrefs

Programs

  • Magma
    [n*Floor((n-k+2)/2): k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 13 2024
    
  • Mathematica
    Table[n*Floor[(n-k+2)/2], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 13 2024 *)
  • SageMath
    flatten([[n*((n-k+2)//2) for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 13 2024

Formula

Sum_{k=1..n} T(n, k) = A128624(n) (row sums).
T(n,k) = n*(1+floor((n-k)/2)), 1 <= k <= n. - R. J. Mathar, Jun 27 2012
From G. C. Greubel, Mar 13 2024: (Start)
T(n, k) = n*A115514(n, k).
T(n, k) = Sum_{j=k..n} A128621(n, j).
T(n, 1) = A093005(n).
T(n, 2) = A093353(n-1), n >= 2.
T(n, n) = A000027(n).
T(2*n-1, n) = A245524(n).
Sum_{k=1..n} (-1)^k*T(n, k) = (1/2)*(1-(-1)^n)*A000384(floor((n+1)/2)). (End)

Extensions

a(41) = 27 inserted and more terms from Georg Fischer, Jun 05 2023

A245534 a(n) = n^2 + floor(n/2)*(-1)^n.

Original entry on oeis.org

1, 5, 8, 18, 23, 39, 46, 68, 77, 105, 116, 150, 163, 203, 218, 264, 281, 333, 352, 410, 431, 495, 518, 588, 613, 689, 716, 798, 827, 915, 946, 1040, 1073, 1173, 1208, 1314, 1351, 1463, 1502, 1620, 1661, 1785, 1828, 1958, 2003, 2139, 2186, 2328, 2377, 2525
Offset: 1

Views

Author

Wesley Ivan Hurt, Jul 25 2014

Keywords

Comments

Consider the partitions of 2n into two parts: When n is odd, a(n) gives the total sum of the odd numbers from the smallest parts and the even numbers from the largest parts of these partitions. When n is even, a(n) gives the total sum of the even numbers from the smallest parts and the odd numbers from the largest parts (see example).

Examples

			a(3) = 8; The partitions of 2*3 = 6 into two parts are: (5,1), (4,2), (3,3). Since 3 is odd, we sum the odd numbers from the smallest parts together with the even numbers from the largest parts to get: (1+3) + (4) = 8.
a(4) = 18; The partitions of 4*2 = 8 into two parts are: (7,1), (6,2), (5,3), (4,4). Since 4 is even, we sum the even numbers from the smallest parts together with the odd numbers from the largest parts to get: (2+4) + (5+7) = 18.
		

Crossrefs

Cf. A001057, A000290. See A245524 for a very similar sequence.

Programs

  • Magma
    [n^2+Floor(n/2)*(-1)^n: n in [1..50]];
    
  • Maple
    A245534:=n->n^2+floor(n/2)*(-1)^n: seq(A245534(n), n=1..50);
  • Mathematica
    Table[n^2 + Floor[n/2] (-1)^n, {n, 50}]
  • PARI
    a(n) = n^2 + (n\2)*(-1)^n; \\ Michel Marcus, Aug 06 2014

Formula

G.f.: x*(1 + 4*x + x^2 + 2*x^3)/((1 + x)^2*(1 - x)^3).
a(n) = (4*n^2 + 1 + (2*n - 1)*(-1)^n)/4.
a(n) = A000290(n) + A001057(n-1) for n > 0.
a(n) = n^2 - Sum_{k=1..n-1} (-1)^k*k for n>1. Example: for n=5, a(5) = 5^2 - (4 - 3 + 2 - 1) = 23. - Bruno Berselli, May 23 2018
Showing 1-2 of 2 results.