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.

A138720 Concatenation of k digits 1, k digits 0 and k digits 1, where k is the n-th positive triangular number.

Original entry on oeis.org

101, 111000111, 111111000000111111, 111111111100000000001111111111, 111111111111111000000000000000111111111111111, 111111111111111111111000000000000000000000111111111111111111111
Offset: 1

Views

Author

Omar E. Pol, Mar 29 2008

Keywords

Crossrefs

Cf. A000217, 138711, A138179, A138721, A138722.

Programs

  • Mathematica
    Table[c=(n(n+1))/2;FromDigits[Join[PadRight[{},c,1],PadRight[{},c,0], PadRight[{},c,1]]],{n,10}] (* Harvey P. Dale, Oct 15 2013 *)

A180572 Triangle read by rows: T(n,k) is the number of unordered pairs of vertices at distance k in the circular ladder P_2 X C_n (also called a prism), where P_2 is the path graph on 2 nodes and C_n is the cycle graph on n nodes.

Original entry on oeis.org

9, 6, 12, 12, 4, 15, 20, 10, 18, 24, 18, 6, 21, 28, 28, 14, 24, 32, 32, 24, 8, 27, 36, 36, 36, 18, 30, 40, 40, 40, 30, 10, 33, 44, 44, 44, 44, 22, 36, 48, 48, 48, 48, 36, 12, 39, 52, 52, 52, 52, 52, 26, 42, 56, 56, 56, 56, 56, 42, 14, 45, 60, 60, 60, 60, 60, 60, 30, 48, 64, 64
Offset: 3

Views

Author

Emeric Deutsch, Sep 16 2010

Keywords

Comments

Row n contains 1 + floor(n/2) entries.
Sum of entries in row n = n(2n-1) = A000384(n).
T(n,1) = 3n = number of edges in the corresponding graph.
Sum_{k>=1} k*T(n,k) = A138179(n).
The generating polynomial of row n (i.e., the Wiener polynomial of the circular ladder of order n) has been obtained from the Wiener polynomial of the cycle C_n (see the Sagan et al. paper) and by determining the distribution of the distances from the nodes of one cycle to the nodes of the other cycle. They can also be derived from the Doslic paper (Corollary 11 and Lemma 1).

Examples

			T(3,2)=6 because in P_2 X C_3 there are six unordered pairs of nodes at distance 2 (from the vertices of the outer triangle to the "opposite" vertices of the inner triangle).
Triangle starts:
   9,  6;
  12, 12,  4;
  15, 20, 10;
  18, 24, 18,  6;
  21, 28, 28, 14;
		

References

  • J. Gross and J. Yellen, Graph Theory and its Applications, CRC, Boca Raton, 1999 (p. 14).

Crossrefs

Programs

  • Maple
    G := t*z^3*(9+6*t-6*z+4*t^2*z-16*t*z^2-10*t^2*z^2+8*t*z^3 +2*t^2*z^3 -2*t^3*z^3 +7*t^2*z^4+4*t^3*z^4-4*t^2*z^5-2*t^3*z^5) / ((1-z)^2*(1-t*z^2)^2): Gser := simplify(series(G, z = 0, 19)): for n from 3 to 16 do P[n] := sort(expand(coeff(Gser, z, n))) end do: for n from 3 to 16 do seq(coeff(P[n], t, j), j = 1 .. 1+floor((1/2)*n)) end do; # yields sequence in triangular form

Formula

The generating polynomial for row 2n+1 is (2n+1)(3t+t^2-2t^{n+1}-2t^{n+2})/(1-t) and for row 2n it is 2n(3t+t^2-t^n-2t^{n+1}-t^{n+2})/(1-t) (these are also the Wiener polynomials of the corresponding circular ladders).
The bivariate g.f. G=G(t,z) appears in the Maple program.

A228313 Triangle read by rows: T(p,q) (1<=q<=p) is the Wiener index of the Cartesian product of the cycles C(p) and C(q) (the torus grid graph).

Original entry on oeis.org

0, 1, 8, 3, 21, 54, 8, 48, 120, 256, 15, 85, 210, 440, 750, 27, 144, 351, 720, 1215, 1944, 42, 217, 525, 1064, 1785, 2835, 4116, 64, 320, 768, 1536, 2560, 4032, 5824, 8192, 90, 441, 1053, 2088, 3465, 5427, 7812, 10944, 14580, 125, 600, 1425, 2800
Offset: 1

Views

Author

Emeric Deutsch, Aug 25 2013

Keywords

Comments

T(n,n) = A122657(n).
T(n,1) = A034828(n).
T(n,2) = A138179(n) (n>=3).

Crossrefs

Programs

  • Maple
    Wi := proc (p, q) if `mod`(p, 2) = 1 and `mod`(q, 2) = 1 then (1/8)*p*q*(p+q)*(p*q-1) elif `mod`(p, 2) = 0 and `mod`(q, 2) = 0 then (1/8)*p^2*q^2*(p+q) elif `mod`(p, 2) = 1 and `mod`(q, 2) = 0 then (1/8)*p*q^2*(p^2+p*q-1) else (1/8)*p^2*q*(q^2+p*q-1) end if end proc: for i to 10 do seq(Wi(i, j), j = 1 .. i) end do; # yields sequence in triangular form
    H := proc (p, q) local br, h: br := proc (n) options operator, arrow: sum(t^k, k = 0 .. n-1) end proc: h := proc (m) if `mod`(m, 2) = 0 then m*(br((1/2)*m)-1)+(1/2)*m*t^((1/2)*m) else m*t*br((1/2)*m-1/2) end if end proc: sort(expand(2*h(p)*h(q)+p*h(q)+q*h(p))) end proc: Wi := proc (p, q) options operator, arrow: subs(t = 1, diff(H(p, q), t)) end proc: for i to 10 do seq(Wi(i, j), j = 1 .. i) end do; # yields sequence in triangular form

Formula

T(p,q) = pq(p+q)(pq - 1)/8 if both p and q are odd.
T(p,q) = p^2*q^2*(p + q)/8 if both p and q are even.
T(p,q) = pq^2*(p^2 - 1 + pq)/8 if p is odd and q is even.
T(p,q) = p^2*q*(q^2 - 1 + pq)/8 if p is even and q is odd.
The first Maple program makes use of the above formulas.
The Hosoya-Wiener polynomial of C(p) X C(q) is 2*h(p)*h(q) + p*h(q) + q*h(p), where h(j) denotes the Hosoya-Wiener polynomial of the cycle C(j).
The command H(p,q) in the 2nd Maple program yields the corresponding Hosoya-Wiener polynomial.

A171437 Square array read by antidiagonals: T(m,n) is the Wiener index of the prism graph C(m) x P(n) (m>=3, n>=1). The Wiener index of a connected graph is the sum of distances between all unordered pairs of vertices in the graph.

Original entry on oeis.org

3, 8, 21, 15, 48, 63, 27, 85, 136, 138, 42, 144, 235, 288, 255, 64, 217, 387, 490, 520, 423, 90, 320, 574, 792, 875, 848, 651, 125, 441, 832, 1162, 1395, 1415, 1288, 948, 165, 600, 1134, 1664, 2030, 2232, 2135, 1856, 1323, 216, 781, 1525, 2250, 2880, 3227
Offset: 3

Views

Author

Emeric Deutsch, Sep 29 2010

Keywords

Comments

T(m,2) = A138179(m).

Examples

			Square array starts:
   3,  21,  63, 138,  255,...
   8,  48, 136, 288,  520,...
  15,  85, 235, 490,  875,...
  27, 144, 387, 792, 1395,...
		

Crossrefs

Cf. A138179.

Programs

  • Maple
    T := proc (m, n) if `mod`(m, 2) = 1 then (1/24)*m*n*(4*m*(n^2-1)+3*n*(m^2-1)) else (1/24)*m^2*n*(4*n^2-4+3*m*n) end if end proc: for m from 3 to 12 do seq(T(m+1-j, j), j = 1 .. m-2) end do; # yields sequence in triangular form

Formula

T(m,n) = (1/24)*m*n*(4*m*(n^2-1)+3*n*(m^2-1)) if m is odd.
T(m,n) = (1/24)*m^2*n*(4*(n^2-1)+3*m*n) if m is even.
The Wiener polynomial p[n](t) for C(2m+1) x P(n) satisfies the recurrence relation p[n]=p[n-1]+p[1]+(2m+1)*a[n], where a[n]=[t+2*sum(t^j,j=2..m+1)*sum(t^j,j=0..n-2) and p[1]=(2m+1)*sum(t^j,j=1..m).
The Wiener polynomial q[n](t) for C(2m) x P(n) satisfies the recurrence relation q[n]=q[n-1]+q[1]+2m*b[n], where b[n]=[t+t^{m+1}+2*sum(t^j,j=2..m)*sum(t^j,j=0..n-2) and q[1]=2m*sum(t^j,j=1..m-1)+m*t^m.
The above recurrence relations yield simple expressions for the Wiener polynomials (however, they are too long for being reproduced here).
Showing 1-4 of 4 results.