OFFSET
0,5
LINKS
Kival Ngaokrajang, Illustration of initial terms
FORMULA
We argue as in A273724. There are n-1 choices for i.
For nontrivial chords we need i != 4i mod n, which means 3i != 0 mod n, and so when n == 0 mod 3 we must subtract 2 from n-1.
A chord occurs twice (but must be counted only once) when j==4i mod n and i==4j mod n, thus when 15i==0 mod n. If n==+/- 5 mod 15 then subtract another 2, if n==0 mod 15 subtract 6.
Putting the pieces together, we obtain the g.f.
8 + x^2/(1-x)^2 - 2/(1-x^3) - 2(x^5+x^10)/(1-x^15) - 6/(1-x^15),
which can be rewritten as
x^2*(9*x^14-7*x^13+x^12+3*x^11-x^10+3*x^9+x^8-x^7+x^6+3*x^5+x^4-x^3+3*x^2-x+1)/((1-x)*(1-x^15)).
MAPLE
ans:=[0, 0];
for n from 2 to 100 do
h:=Array(0..n-1, 0..n-1, 0); ct:=0;
for i from 1 to n-1 do j := (M*i mod n);
if i<j then if h[i, j]=0 then ct:=ct+1; h[i, j]:=1; fi;
elif i>j then if h[j, i]=0 then ct:=ct+1; h[j, i]:=1; fi;
fi;
od:
ans:=[op(ans), ct];
od:
ans; # N. J. A. Sloane, Jun 24 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Brooke Logan, Jun 24 2016
STATUS
approved