login
A177720
Number of line segments connecting exactly 4 points in an n x n grid of points
2
0, 0, 0, 10, 28, 54, 104, 170, 252, 394, 568, 774, 1068, 1410, 1800, 2374, 3028, 3762, 4656, 5646, 6732, 8190, 9792, 11538, 13636, 15910, 18360, 21334, 24532, 27954, 31856, 36014, 40428, 45798, 51504, 57546, 64228, 71278, 78696, 87466, 96700
OFFSET
1,4
COMMENTS
a(n) is also the number of pairs of points visible to each other exactly through 2 points in an n x n grid of points.
FORMULA
See Mathematica code.
MATHEMATICA
j=3;
a[n_]:=a[n]=If[n<=j, 0, 2*a1[n]-a[n-1]+R1[n]]
a1[n_]:=a1[n]=If[n<=j, 0, 2*a[n-1]-a1[n-1]+R2[n]]
R1[n_]:=R1[n]=If[n<=j, 0, R1[n-1]+4*S[n]]
R2[n_]:=(n-1)*S[n]
S[n_]:=If[Mod[n-1, j]==0, EulerPhi[(n-1)/j], 0]
Table[a[n], {n, 1, 50}]
CROSSREFS
Sequence in context: A273195 A069953 A113746 * A117464 A081273 A060544
KEYWORD
nonn
AUTHOR
Seppo Mustonen, May 13 2010
STATUS
approved