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.

A200068 Irregular triangle read by rows: T(n,k), n>=0, 0<=k<=A200067(n), is number of compositions of n such that the sum of weighted inversions equals k and weights are products of absolute differences and distances between the element pairs which are not in sorted order.

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 1, 1, 1, 7, 3, 1, 3, 0, 0, 2, 11, 4, 2, 4, 3, 1, 3, 0, 1, 1, 1, 0, 1, 15, 8, 3, 8, 3, 3, 7, 1, 2, 3, 1, 3, 2, 0, 1, 2, 0, 0, 1, 0, 1, 22, 11, 7, 12, 4, 5, 13, 5, 4, 7, 4, 4, 5, 0, 3, 6, 2, 1, 2, 1, 2, 3, 0, 0, 2, 1, 0, 0, 0, 0, 2
Offset: 0

Views

Author

Alois P. Heinz, Nov 13 2011

Keywords

Examples

			The compositions of n = 4 have weighted inversions 0: [4], [2,2], [1,3], [1,1,2], [1,1,1,1]; 1: [1,2,1]; 2: [3,1]; 3: [2,1,1];  => row 4 = [5,1,1,1].
Irregular triangle begins:
   1;
   1;
   2;
   3, 1;
   5, 1, 1, 1;
   7, 3, 1, 3, 0, 0, 2;
  11, 4, 2, 4, 3, 1, 3, 0, 1, 1, 1, 0, 1;
  15, 8, 3, 8, 3, 3, 7, 1, 2, 3, 1, 3, 2, 0, 1, 2, 0, 0, 1, 0, 1;
  ...
		

Crossrefs

Cf. A000041 (column k=0), A024786(n-1) (column k=1), A011782 (row sums), A200067 (row lengths -1), A189074.

Programs

  • Maple
    T:= proc(n) option remember; local mx, b, p;
          b:=proc(m, i, l) local h;
               if m=0 then p(i):= p(i)+1; if i>mx then mx:=i fi
             else seq(b(m-h, i +add(`if`(l[j]
    				
  • Mathematica
    T[n_] := T[n] = Module[{mx, b, p},
         b[m_, i_, l_] := Module[{h},
              If[m == 0, p[i] = p[i]+1; If[i > mx, mx = i],
              Table[b[m-h, i + Sum[If[l[[j]] < h, j*(h - l[[j]]), 0],
                   {j, 1, Length[l]}], Join[{h}, l]], {h, 1, m}]]];
         mx = 0;
         p[_] = 0;
         b[n, 0, {}]; Table[p[i], {i, 0, mx}]];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 25 2022, after Alois P. Heinz *)

A307559 a(n) = floor(n/3)*(n - floor(n/3))*(n - floor(n/3) - 1).

Original entry on oeis.org

0, 0, 2, 6, 12, 24, 40, 60, 90, 126, 168, 224, 288, 360, 450, 550, 660, 792, 936, 1092, 1274, 1470, 1680, 1920, 2176, 2448, 2754, 3078, 3420, 3800, 4200, 4620, 5082, 5566, 6072, 6624, 7200, 7800, 8450, 9126, 9828, 10584, 11368, 12180, 13050, 13950, 14880, 15872
Offset: 1

Views

Author

Emeric Deutsch, Apr 14 2019

Keywords

Comments

a(n) is an upper bound for the irregularity of a graph with n vertices (see Theorem 3.2 of the Tavakoli et al. reference).

Examples

			a(4) = floor(4/3)*(4 - floor(4/3))*(4-floor(4/3)-1) = 1*3*2 = 6.
		

Crossrefs

Cf. A200067.

Programs

  • Maple
    a:=n->floor(n/3)*(n-floor(n/3))*(n-floor(n/3)-1): seq(a(n), n=1..50);

Formula

a(n) = 2*A200067(n).
G.f.: 2*x^3*(1+x)*(1+x^2) / ( (1+x+x^2)^2*(x-1)^4 ). - R. J. Mathar, Jul 22 2022
Showing 1-2 of 2 results.