OFFSET
2,8
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..10000
EXAMPLE
a(5) = 1 because in a circle with the numbers from 1 to 5 we can put a chord from 1 and 4 and the sum of both sides is the same.
a(9) = 2 as in a circle with the numbers from 1 to 9 we can put a chord in two ways, one from 2 to 7 and another from 6 to 9.
MAPLE
a:= proc(n) local c, i, j, u, v;
c, i, j, u, v:= 0, 1, 2, 0, n*(n+1)/2-3;
while j<=n do
c:= c + `if`(u=v, 1, 0);
if u>v then u, v:= u-i-1, v+i; i:=i+1
else u, v:= u+j, v-j-1; j:=j+1
fi;
od; c
end:
seq(a(n), n=2..100); # Alois P. Heinz, Sep 12 2011
MATHEMATICA
a[n_] := Module[{c = 0, i = 1, j = 2, u = 0, v = n(n+1)/2 - 3}, While[j <= n, c += If[u == v, 1, 0]; If[u > v, {u, v} = {u - i - 1, v + i}; i++, {u, v} = {u + j, v - j - 1}; j++]]; c];
a /@ Range[2, 100] (* Jean-François Alcover, Nov 18 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joao B. Oliveira (oliveira(AT)inf.pucrs.br), Oct 18 2005
STATUS
approved