A177721 Number of line segments connecting exactly 5 points in an n x n grid of points.
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
Keywords
Links
- S. Mustonen, On lines going through a given number of points in a rectangular grid of points
- Seppo Mustonen, On lines going through a given number of points in a rectangular grid of points [Local copy]
Programs
-
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}]
Formula
See Mathematica code.
Comments