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.

A135565 Number of line segments in regular n-gon with all diagonals drawn.

Original entry on oeis.org

0, 1, 3, 8, 20, 42, 91, 136, 288, 390, 715, 756, 1508, 1722, 2835, 3088, 4896, 4320, 7923, 8360, 12180, 12782, 17963, 16344, 25600, 26494, 35451, 36456, 47908, 38310, 63395, 64800, 82368, 84082, 105315, 99972, 132756, 135014, 165243, 167720
Offset: 1

Views

Author

Keywords

Comments

A line segment (or edge) is considered to end at any vertex where two or more chords meet.
I.e., edge count of the n-polygon diagonal intersection graph. - Eric W. Weisstein, Mar 08 2018

Crossrefs

Sequences related to chords in a circle: A001006, A054726, A006533, A006561, A006600, A007569, A007678. See also entries for chord diagrams in Index file.

Programs

  • Mathematica
    del[m_, n_] := Boole[Mod[n, m] == 0];
    A007569[n_] :=
    If[n < 4, n,
      n + Binomial[n, 4] + del[2, n] (-5 n^3 + 45 n^2 - 70 n + 24)/24 -
       del[4, n] (3 n/2) + del[6, n] (-45 n^2 + 262 n)/6 +
       del[12, n]*42 n + del[18, n]*60 n + del[24, n]*35 n -
       del[30, n]*38 n - del[42, n]*82 n - del[60, n]*330 n -
       del[84, n]*144 n - del[90, n]*96 n - del[120, n]*144 n -
       del[210, n]*96 n];
    A007678[n_] :=
      If[n < 3,
       0, (n^4 - 6 n^3 + 23 n^2 - 42 n + 24)/24 +
        del[2, n] (-5 n^3 + 42 n^2 - 40 n - 48)/48 - del[4, n] (3 n/4) +
        del[6, n] (-53 n^2 + 310 n)/12 + del[12, n] (49 n/2) +
        del[18, n]*32 n + del[24, n]*19 n - del[30, n]*36 n -
        del[42, n]*50 n - del[60, n]*190 n - del[84, n]*78 n -
        del[90, n]*48 n - del[120, n]*78 n - del[210, n]*48 n];
    a[n_] := A007569[n] + A007678[n] - 1;
    Array[a, 40] (* Jean-François Alcover, Sep 07 2017, after Max Alekseyev, using T. D. Noe's code for A007569 and A007678 *)

Formula

a(n) = A007569(n) + A007678(n) - 1. - Max Alekseyev