|
|
A092866
|
|
Number of intersections inside an equilateral triangular figure formed by the straight line segments mutually connecting all vertices and all points that divide the sides into n equal parts. If three or more lines meet at an interior point this intersection is counted only once.
|
|
26
|
|
|
0, 4, 49, 166, 543, 1237, 2511, 4762, 7777, 12262, 18933, 28504, 39078, 56065, 73879, 95962, 124653, 164761, 203259, 258646, 311233, 377932, 458793, 560755, 648936, 775258, 908893, 1056520, 1215087, 1428193, 1607871, 1866007, 2111488, 2399545, 2694010, 3040201, 3356433, 3811387, 4253074, 4720102, 5180466, 5806687, 6324906, 7035949, 7690900, 8392036, 9180330, 10136287, 10894551, 11930833
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
A detailed example for n=5 is given at the Pfoertner link.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(2)=4 because there are 3 intersection points between the triangle medians and the line segments connecting the midpoints of the sides plus the intersection of the 3 medians at the centroid.
|
|
MAPLE
|
Inter:= proc(p1x, p1y, p2x, p2y, q1x, q1y, q2x, q2y)
local det, x, y;
det:= p1x*q1y-p1x*q2y-p1y*q1x+p1y*q2x-p2x*q1y+p2x*q2y+p2y*q1x-p2y*q2x;
if det = 0 then return NULL fi;
x:= (p1x*p2y*q1x-p1x*p2y*q2x-p1x*q1x*q2y+p1x*q1y*q2x-p1y*p2x*q1x+p1y*p2x*q2x+p2x*q1x*q2y-p2x*q1y*q2x)/det;
y:= (p1x*p2y*q1y-p1x*p2y*q2y-p1y*p2x*q1y+p1y*p2x*q2y-p1y*q1x*q2y+p1y*q1y*q2x+p2y*q1x*q2y-p2y*q1y*q2x)/det;
if x >0 and y > 0 and x + y < 1 then [x, y]
else NULL
fi
end proc:
F:= proc(n) local A, B, C, Pairs, Pts;
A:= [seq([j/n, 0], j=0..n)];
B:= [seq([0, j/n], j=0..n)];
C:= [seq([j/n, 1-j/n], j=0..n)];
Pairs:= [seq(seq([A[i], B[j]], i=2..n+1), j=2..n+1),
seq(seq([A[i], C[j]], i=1..n), j=1..n),
seq(seq([B[i], C[j]], i=1..n), j=2..n+1)];
Pts:= {seq(seq(Inter(op(Pairs[i][1]), op(Pairs[i][2]), op(Pairs[j][1]), op(Pairs[j][2])), j=1..i-1), i=2..nops(Pairs))};
nops(Pts);
end proc:
|
|
MATHEMATICA
|
Inter[{p1x_, p1y_}, {p2x_, p2y_}, {q1x_, q1y_}, {q2x_, q2y_}] := Module[ {det, x, y}, det = p1x q1y - p1x q2y - p1y q1x + p1y q2x - p2x q1y + p2x q2y + p2y q1x - p2y q2x; If[det == 0, Return[Nothing]]; x = (p1x p2y q1x - p1x p2y q2x - p1x q1x q2y + p1x q1y q2x - p1y p2x q1x + p1y p2x q2x + p2x q1x q2y - p2x q1y q2x)/det; y = (p1x p2y q1y - p1x p2y q2y - p1y p2x q1y + p1y p2x q2y - p1y q1x q2y + p1y q1y q2x + p2y q1x q2y - p2y q1y q2x)/det; If[x > 0 && y > 0 && x + y < 1, {x, y}, Nothing]];
F[n_] := F[n] = Module[{A, B, K, Pairs, Pts}, A = Table[{j/n, 0}, {j, 0, n}]; B = Table[{0, j/n}, {j, 0, n}]; K = Table[{j/n, 1 - j/n}, {j, 0, n}]; Pairs = {Table[Table[{A[[i]], B[[j]]}, {i, 2, n+1}], {j, 2, n+1}], Table[Table[{A[[i]], K[[j]]}, {i, 1, n}], {j, 1, n}], Table[Table[ {B[[i]], K[[j]]}, {i, 1, n}], {j, 2, n+1}]} // Flatten[#, 2]&; Pts = Table[Table[Inter[Pairs[[i, 1]], Pairs[[i, 2]], Pairs[[j, 1]], Pairs[[j, 2]]], {j, 1, i-1}], {i, 2, Length[Pairs]}]; Flatten[Pts, 1] // Union // Length];
|
|
CROSSREFS
|
Cf. A092867 (regions formed by the diagonals), A274585 (points both inside and on the triangle sides), A274586 (edges).
Cf. A006561 (number of intersections of diagonals of regular n-gon), A091908 (intersections between line segments connecting vertices with subdivision points on opposite side).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|