login
A177721
Number of line segments connecting exactly 5 points in an n x n grid of points
0
0, 0, 0, 0, 12, 32, 60, 96, 160, 240, 336, 448, 632, 848, 1096, 1376, 1760, 2192, 2672, 3200, 3952, 4784, 5696, 6688, 7864, 9136, 10504, 11968, 13888, 15952, 18160, 20512, 23280, 26224, 29344, 32640, 36568, 40720, 45096, 49696, 54856, 60272, 65944
OFFSET
1,5
COMMENTS
a(n) is also the number of pairs of points visible to each other exactly through 3 points in an n x n grid of points.
FORMULA
See Mathematica code.
MATHEMATICA
j=4;
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: A305074 A166959 A134582 * A081268 A332595 A188183
KEYWORD
nonn
AUTHOR
Seppo Mustonen, May 13 2010
STATUS
approved