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.

A129530 a(n) = (1/2)*n*(n-1)*3^(n-1).

Original entry on oeis.org

0, 0, 3, 27, 162, 810, 3645, 15309, 61236, 236196, 885735, 3247695, 11691702, 41452398, 145083393, 502211745, 1721868840, 5854354056, 19758444939, 66248903619, 220829678730, 732224724210, 2416341589893, 7939408081077
Offset: 0

Views

Author

Emeric Deutsch, Apr 22 2007

Keywords

Comments

Number of inversions in all ternary words of length n on {0,1,2}. Example: a(2)=3 because each of the words 10,20,21 has one inversion and the words 00,01,02,11,12,22 have no inversions. a(n)=3*A027472(n+1). a(n)=Sum(k*A129529(n,k),k>=0).

Crossrefs

Programs

  • Maple
    seq(n*(n-1)*3^(n-1)/2,n=0..27);
  • Mathematica
    Table[(n(n-1)3^(n-1))/2,{n,0,30}] (* or *) LinearRecurrence[{9,-27,27},{0,0,3},30] (* Harvey P. Dale, Dec 18 2013 *)
  • PARI
    a(n)=n*(n-1)*3^(n-1)/2 \\ Charles R Greathouse IV, Oct 16 2015

Formula

G.f.: 3x^2/(1-3x)^3.
a(0)=0, a(1)=0, a(2)=3, a(n)=9*a(n-1)-27*a(n-2)+27*a(n-3). - Harvey P. Dale, Dec 18 2013
From Amiram Eldar, Jan 12 2021: (Start)
Sum_{n>=2} 1/a(n) = 2 * (1 - 2 * log(3/2)).
Sum_{n>=2} (-1)^n/a(n) = 2*(4*log(4/3) - 1). (End)
a(n) = 3*A027472(n+1). - R. J. Mathar, Jul 26 2022

A380993 Irregular triangular array read by rows. T(n,k) is the number of ternary words of length n containing at least one copy of each letter and having exactly k inversions, n>=3, 0<=k<=floor(n^2/3).

Original entry on oeis.org

1, 2, 2, 1, 3, 6, 9, 9, 6, 3, 6, 12, 21, 27, 30, 24, 18, 9, 3, 10, 20, 38, 55, 74, 81, 80, 69, 53, 34, 17, 8, 1, 15, 30, 60, 93, 138, 174, 210, 216, 219, 195, 165, 120, 84, 48, 27, 9, 3, 21, 42, 87, 141, 222, 303, 405, 480, 546, 579, 588, 552, 498, 414, 324, 240, 162, 99, 54, 27, 9, 3
Offset: 3

Views

Author

Geoffrey Critzer, Feb 11 2025

Keywords

Examples

			Triangle T(n,k) begins:
   1,  2,  2,  1;
   3,  6,  9,  9,  6,  3;
   6, 12, 21, 27, 30, 24, 18,  9,  3;
  10, 20, 38, 55, 74, 81, 80, 69, 53, 34, 17, 8, 1;
  ...
T(4,2) = 9 because we have: {0, 1, 2, 0}, {0, 2, 0, 1}, {0, 2, 1, 1}, {0, 2, 2, 1}, {1, 0, 0, 2}, {1, 0, 2, 1}, {1, 1, 0, 2}, {1, 2, 0, 2}, {2, 0, 1, 2}.
		

Crossrefs

Cf. A056454, A129529, A001117 (row sums).

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, `if`(nops(subs(0=
          [][], l))=3, 1, 0), add(expand(x^([0, l[1], l[1]+l[2]][j])*
          b(n-1, subsop(j=`if`(j=3, 1, l[j]+1), l))), j=1..3))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [0$3])):
    seq(T(n), n=3..10);  # Alois P. Heinz, Feb 12 2025
  • Mathematica
    nn = 8; B[n_] := FunctionExpand[QFactorial[n, u]];
    e[z_] := Sum[z^n/B[n], {n, 0, nn}];
    Drop[Map[CoefficientList[#, u] &,
       Map[Normal[Series[#, {u, 0, Binomial[nn, 2]}]] &,
        Table[B[n], {n, 0, nn}] CoefficientList[
          Series[(e[z] - 1)^3, {z, 0, nn}], z]]], 3] // Grid

Formula

Sum_{n>=0} Sum_{k>=0} T(n,k)*q^k*x^n/B(n) = (e(x)-1)^3 where B(n) = Product_{i=1..n} (q^i-1)/(q-1) and e(x) = Sum_{n>=0} x^n/B(n).
Sum_{k=0..floor(n^2/3)} (-1)^k * T(n,k) = A056454(n). - Alois P. Heinz, Feb 12 2025

A381930 Irregular triangular array read by rows. T(n,k) is the number of length n words x on {0,1,2} such that I(x) + W_0(x)*W_1(x) + W_0(x)*W_2(x) + W_1(x)*W_2(x) = k where I(x) is the number of inversions in x and W_i(x) is the number of occurrences of the letter i in x for i={0,1,2}, n>=0, 0<=k<=floor(2n^2/3).

Original entry on oeis.org

1, 3, 3, 3, 3, 3, 0, 6, 7, 8, 2, 1, 3, 0, 0, 6, 9, 12, 18, 12, 12, 6, 3, 3, 0, 0, 0, 6, 6, 12, 15, 27, 27, 36, 33, 33, 21, 15, 6, 3, 3, 0, 0, 0, 0, 6, 6, 6, 12, 18, 27, 33, 52, 62, 77, 82, 86, 75, 68, 48, 35, 19, 11, 2, 1
Offset: 0

Views

Author

Geoffrey Critzer, Mar 10 2025

Keywords

Comments

Sum_{k>=0} T(n,k)*2^k = A342245(n).
Sum_{k>=0} T(n,k)*q^k = the number of ordered pairs (S,T) of idempotent n X n matrices over GF(q) such that ST=TS=S.

Examples

			Triangle T(n,k) begins:
  1;
  3;
  3, 3, 3;
  3, 0, 6, 7, 8,  2,  1;
  3, 0, 0, 6, 9, 12, 18, 12, 12,  6,  3;
  3, 0, 0, 0, 6,  6, 12, 15, 27, 27, 36, 33, 33, 21, 15, 6, 3;
  ...
T(3,3) = 7 because we have: {0, 1, 0}, {0, 1, 2}, {0, 2, 0}, {1, 0, 1}, {1, 2, 1}, {2, 0, 2}, {2, 1, 2}.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, j, k) option remember; expand(
         `if`(n=0, z^(i*j+i*k+j*k), b(n-1, i+1, j, k)*z^(j+k)+
          b(n-1, i, j+1, k)*z^k +b(n-1, i, j, k+1)))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$3)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Mar 10 2025
  • Mathematica
    nn = 6; B[n_] := FunctionExpand[QFactorial[n, q]]*q^Binomial[n, 2];e[z_] := Sum[z^n/B[n], {n, 0, nn}];Map[CoefficientList[#, q] &,Table[B[n], {n, 0, nn}] CoefficientList[Series[e[z]^3, {z, 0, nn}],z]] // Grid

Formula

Sum_{n>=0} Sum_{k>=0} T(n,k)*q^k*x^n/(n_q!*q^binomial(n,2)) = e(x)^3 where e(x) = Sum_{n>=0} x^n/(n_q!*q^binomial(n,2)) where n_q! = Product{i=1..n} (q^n-1)/(q-1).
From Alois P. Heinz, Mar 10 2025: (Start)
Sum_{k>=0} k * T(n,k) = 9 * A027472(n+1).
Sum_{k>=0} (-1)^k * T(n,k) = A056449(n). (End)
Showing 1-3 of 3 results.