login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A222267 The number of distinct lines defined by an n X n X n grid of points. 3

%I

%S 28,253,1492,5485,17092,41905,95140,191773,364420,638785,1085500,

%T 1745389,2743084,4136257,6101740,8747821,12377764,17066737,23287564,

%U 31174813,41276548,53767873,69544324,88722973,112450132,140859361,175324636

%N The number of distinct lines defined by an n X n X n grid of points.

%C Given a cubic n X n X n grid of points, a(n) is the number of distinct lines produced by constructing a line through every pair of points.

%C Define the grid as consisting of the set of n^3 distinct points whose x-, y-, and z-coordinates are all integers in [0..n-1]. Assign to each grid point a distinct index j = x + n*y + n^2*z. For each pair of grid points P_A and P_B (where P_A is the one with the lower index j), let L be the line that passes through both grid points, and let S be the segment of that line from P_A to P_B. Examine each of the C(n^3,2) pairs of distinct grid points P_A and P_B; a(n) is the number of those pairs for which S does not pass through any other grid points between P_A and P_B, nor does L pass through any other grid points beyond the P_A end of S. - _Jon E. Schoenfield_, Sep 21 2013

%H Jon E. Schoenfield, <a href="/A222267/b222267.txt">Table of n, a(n) for n = 2..70</a>

%H Clive Tooth, <a href="/A222267/a222267.cs.txt">A C# class declaration</a>

%e Each of the 28 pairs of points on a 2 X 2 X 2 grid of points defines a distinct line, so a(2) = 28.

%e Of the 351 pairs of points on a 3 X 3 X 3 grid, there are only 253 distinct lines, so a(3) = 253.

%t mq[{x1_, y1_}, {x2_, y2_}] := If[x1 == x2, {x1}, {y2 - y1, x2*y1 - x1*y2}/(x2 - x1)]; two[n_] := Block[{p = Tuples[Range@n, 2]},

%t Length@Union@Flatten[Table[mq[p[[i]], p[[j]]], {i, 2, n^2}, {j, i - 1}], 1]]; coef[a_, b_] := Block[{d = b - a}, If[d[[1]] == 0, {0}, d *= Sign@d[[1]]/GCD @@ d; {a - d*a[[1]]/d[[1]], d}]]; a[n_] := Block[{p = Tuples[Range@n, 3]}, n*two[n] - 1 + Length@Union@ Flatten[Table[coef[p[[i]], p[[j]]], {i, 2, n^3}, {j, i - 1}], 1]]; Table[v = a[n]; Print@v; v, {n, 2, 12}] (* _Giovanni Resta_, Feb 14 2013 *)

%Y Cf. A222268 (number of distinct points of intersection of these a(n) lines), A018808.

%K nonn,nice

%O 2,1

%A _Clive Tooth_, Feb 13 2013

%E a(6)-a(12) from _Giovanni Resta_, Feb 14 2013

%E a(13)-a(28) from _Jon E. Schoenfield_, Sep 16 2013

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

Content is available under The OEIS End-User License Agreement .

Last modified September 12 17:10 EDT 2015. Contains 261564 sequences.