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.

A367204 Number of diagonals in a regular n-gon that are parallel to an edge.

Original entry on oeis.org

0, 0, 5, 3, 14, 8, 27, 15, 44, 24, 65, 35, 90, 48, 119, 63, 152, 80, 189, 99, 230, 120, 275, 143, 324, 168, 377, 195, 434, 224, 495, 255, 560, 288, 629, 323, 702, 360, 779, 399, 860, 440, 945, 483, 1034, 528, 1127, 575, 1224, 624, 1325, 675, 1430, 728, 1539, 783
Offset: 3

Views

Author

Paolo Xausa, Nov 10 2023

Keywords

Comments

A diagonal is parallel to an edge if and only if, on at least one side of the diagonal, there is an odd number of edges.
If n is odd, all of the diagonals of the n-gon are parallel to an edge.

Crossrefs

Even-indexed terms of A000096 interleaved with A005563.

Programs

  • Mathematica
    LinearRecurrence[{0,3,0,-3,0,1},{0,0,5,3,14,8},100] (* or *)
    A367204[n_]:=If[OddQ[n],n(n-3)/2,n(n-4)/4];Array[A367204,100,3]
  • Python
    def A367204(n): return n*(n-3)>>1 if n&1 else n*(n-4)>>2 # Chai Wah Wu, Nov 22 2023

Formula

a(n) = n(n-3)/2 = A000096(n-3) if n is odd;
a(n) = n(n-4)/4 = A005563((n-4)/2) = A000096(n-3) - A002378(n/2-1) if n is even.
Sum_{n>=5} 1/a(n) = 59/36 - 2*log(2)/3. - Amiram Eldar, Dec 06 2024

A211380 Number of pairs of intersecting diagonals in the interior and exterior of a regular n-gon.

Original entry on oeis.org

0, 1, 5, 15, 42, 94, 189, 340, 572, 903, 1365, 1981, 2790, 3820, 5117, 6714, 8664, 11005, 13797, 17083, 20930, 25386, 30525, 36400, 43092, 50659, 59189, 68745, 79422, 91288, 104445, 118966, 134960, 152505, 171717, 192679, 215514, 240310, 267197, 296268, 327660
Offset: 3

Views

Author

Martin Renner, Feb 07 2013

Keywords

Crossrefs

Programs

  • Maple
    a:=n->piecewise(n mod 2 = 0,1/8*n*(n^3-11*n^2+43*n-58),n mod 2 = 1,1/8*n*(n-3)*(n^2-8*n+19),0);
  • Mathematica
    Drop[CoefficientList[Series[x^4(2x^5-3x^4-7x^3-x^2-2x-1)/((x-1)^5(x+1)^2),{x,0,50}],x],3] (* or *) LinearRecurrence[{3,-1,-5,5,1,-3,1},{0,1,5,15,42,94,189},50] (* Harvey P. Dale, Dec 03 2022 *)
  • Python
    def A211380(n): return n*(n*(n*(n-11)+43)-58+(n&1))>>3 # Chai Wah Wu, Nov 22 2023

Formula

a(n) = 1/8*n*(n^3-11*n^2+43*n-58) for n even;
a(n) = 1/8*n*(n-3)*(n^2-8*n+19) for n odd.
a(n) = A176145(n) - A211379(n).
G.f.: x^4*(2*x^5-3*x^4-7*x^3-x^2-2*x-1) / ((x-1)^5*(x+1)^2). [Colin Barker, Feb 14 2013]
Showing 1-2 of 2 results.