cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A018808 Number of lines through at least 2 points of an n X n grid of points.

This page as a plain text file.
%I A018808 #51 Jun 05 2023 09:22:40
%S A018808 0,0,6,20,62,140,306,536,938,1492,2306,3296,4722,6460,8830,11568,
%T A018808 14946,18900,23926,29544,36510,44388,53586,63648,75674,88948,104374,
%U A018808 121032,139966,160636,184466,209944,239050,270588,305478,342480,383370,427020
%N A018808 Number of lines through at least 2 points of an n X n grid of points.
%H A018808 Seiichi Manyama, <a href="/A018808/b018808.txt">Table of n, a(n) for n = 0..1000</a> (terms 0..100 from T. D. Noe)
%H A018808 M. A. Alekseyev, M. Basova, N. Yu. Zolotykh. <a href="http://dx.doi.org/10.1137/140978090">On the minimal teaching sets of two-dimensional threshold functions</a>. SIAM J. Disc. Math. 29(1), 2015, pp. 157-165.
%H A018808 A.-M. Ernvall-Hytonen, K. Matomaki, P. Haukkanen, J. K. Merikoski, <a href="http://dx.doi.org/10.1007/s00605-010-0236-6">Formulas for the number of gridlines</a>, Monatsh. f. Mathem. 164 (2) (2011) 157-170
%H A018808 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 [math.CO], 2011.
%H A018808 S. Mustonen, <a href="http://www.survo.fi/papers/PointsInGrid.pdf">On lines and their intersection points in a rectangular grid of points</a>
%H A018808 Seppo Mustonen, <a href="/A018808/a018808.pdf">On lines and their intersection points in a rectangular grid of points</a> [Local copy]
%F A018808 (1/2) * (f(n, 1) - f(n, 2)) where f(n, k) = Sum ((n - |x|)(n - |y|)); -n < x < n, -n < y < n, (x, y)=k.
%F A018808 (1/2) * (f(n, 1) - f(n, 2)) where f(n, k) = Sum ((n - |kx|)(n - |ky|)); -n < kx < n, -n < ky < n, (x, y)=1. - _Seppo Mustonen_, Apr 18 2009
%F A018808 a(0) = L(0,1) = R1(0) = 0, a(n) = L(n,n) = 2L(n-1,n) - L(n-1,n-1) + R1(n), L(n-1,n) = 2L(n-1,n-1) - L(n-2,n-1) + R2(n), R1(n) = R1(n-1) + 4(phi(n-1) - e(n)), e(n)=0, n even, e(n) = phi((n-1)/2), n odd, R2(n) = (n-1)phi(n-1), n even, R2(n)=(n-1)phi(n-1)/2, n=1 mod 4, R2(n)=0, n=3 mod 4. - _Seppo Mustonen_, Apr 25 2009
%F A018808 a(n) = 2 * A331780(n). - _Alois P. Heinz_, Jun 05 2023
%t A018808 L[0]=0; L1[1]=0; R1[1]=0;
%t A018808 L[n_]:=L[n]=2*L1[n]-L[n-1]+R1[n]
%t A018808 L1[n_]:=L1[n]=2*L[n-1]-L1[n-1]+R2[n]
%t A018808 R1[n_]:=R1[n]=R1[n-1]+4*(EulerPhi[n-1]-e[n])
%t A018808 e[n_]:=If[Mod[n,2]==0,0,EulerPhi[(n-1)/2]]
%t A018808 R2[n_]:= If[Mod[n,2]==0,(n-1)*EulerPhi[n-1], If[Mod[n,4]==1,(n-1)*EulerPhi[n-1]/2,0]]
%t A018808 Table[L[n],{n,0,37}] (* _Seppo Mustonen_, Apr 25 2009 *)
%Y A018808 Cf. A222267 (lines defined by n X n X n grid of points).
%Y A018808 A288187 is the main entry for these graphs.
%Y A018808 Cf. A331780.
%K A018808 nonn,nice
%O A018808 0,3
%A A018808 _David W. Wilson_