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!)
A190312 Number of scalene triangles on an n X n grid (or geoboard). 1
0, 0, 40, 368, 1704, 5704, 15400, 36096, 75632, 145968, 263592, 451392, 738360, 1163552, 1774840, 2632344, 3808992, 5394752, 7493936, 10233832, 13759008, 18241312, 23877984, 30896984, 39551456, 50137240, 62983128, 78459880 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
Eric Weisstein's World of Mathematics, Geoboard.
Eric Weisstein's World of Mathematics, Scalene Triangle.
FORMULA
a(n) = A045996(n) - A186434(n).
MATHEMATICA
q[n_] :=
Module[{sqDist, t0, t1, t2},
(* Squared distances *)
sqDist = {p_, q_} :> (Floor[p/n] - Floor[q/n])^2 + (Mod[p, n] - Mod[q, n])^2;
(* Triads of points *)
t0 = Subsets[Range[0, n^2 - 1], {3, 3}];
(* Exclude collinear vertices *)
t1 = Select[t0, Det[Map[{Floor[#/n], Mod[#, n], 1} &, {#[[1]], #[[2]], #[[
3]]}]] != 0 &];
(* Calculate sides *)
t2 = Map[{#,
Sort[{{#[[2]], #[[3]]}, {#[[3]], #[[1]]}, {#[[1]], #[[2]]}} /. sqDist]}&, t1];
(* Select scalenes *)
t2 = Select[t2,
#[[2, 1]] != #[[2, 2]] && #[[2, 2]] != #[[2, 3]] && #[[2, 3]] != #[[2, 1]] &];
Return[Length[t2]];
];
Map[q[#] &, Range[9]] (* César Eliud Lozada, Mar 26 2021 *)
CROSSREFS
Sequence in context: A251431 A285919 A234913 * A229532 A252180 A008355
KEYWORD
nonn
AUTHOR
Martin Renner, May 08 2011
STATUS
approved

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 March 29 05:48 EDT 2024. Contains 371265 sequences. (Running on oeis4.)