login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225606 Number of distinct lines passing through 3 or more points in an n X n grid. 4

%I #36 Oct 30 2018 03:30:07

%S 0,0,0,8,14,32,58,108,174,296,406,628,898,1216,1582,2188,2754,3528,

%T 4398,5524,6778,8336,9778,11812,14038,16456,19066,22540,25954,29968,

%U 34270,39116,44282,50312,56026,63196,70798,78984

%N Number of distinct lines passing through 3 or more points in an n X n grid.

%H P. Haukkanen, J. K. Merikoski, <a href="http://arxiv.org/abs/1108.1041">Some formulas for numbers of line segments and lines in a rectangular grid</a>, arXiv:1108.1041

%H R. J. Mathar, <a href="/A225606/a225606.txt">Maple program implementing A225606, A018808 and sequ. in comment of A187397</a>

%F a(n) = A018808(n) - A018809(n) = A018810(n) + A018811(n) + A018812(n) + A018813(n)+....

%t f[n_, k_] := Sum[x = kx/k; y = ky/k; If[IntegerQ[x] && IntegerQ[y] && CoprimeQ[x, y], (n - Abs[kx])(n - Abs[ky]), 0], {kx, -n + 1, n - 1}, {ky, -n + 1, n - 1}];

%t a[n_] := (f[n, 2] - f[n, 3])/2;

%t Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Oct 30 2018, after _Seppo Mustonen_ in A018808 *)

%K nonn

%O 0,4

%A _R. J. Mathar_, Aug 06 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 14:49 EDT 2024. Contains 371914 sequences. (Running on oeis4.)