|
|
A070083
|
|
Perimeters of integer triangles, sorted by perimeter, sides lexicographically ordered.
|
|
18
|
|
|
3, 5, 6, 7, 7, 8, 9, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
A005044(p) is the number of all integer triangles having perimeter p.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
maxPer = 19; maxSide = Floor[(maxPer-1)/2]; order[{a_, b_, c_}] := (a+b+c)*maxPer^3 + a*maxPer^2 + b*maxPer + c; triangles = Reap[Do[If[ a+b+c <= maxPer && c-b < a < c+b && b-a < c < b+a && c-a < b < c+a, Sow[{a, b, c}]], {a, 1, maxSide}, {b, a, maxSide}, {c, b, maxSide}]][[2, 1]]; Total /@ Sort[triangles, order[#1] < order[#2] &] (* Jean-François Alcover, Jun 12 2012 *)
maxPer = m = 22; sides[per_] := Select[Reverse /@ IntegerPartitions[per, {3}, Range[Ceiling[per/2]]], #[[1]] < per/2 && #[[2]] < per/2 && #[[3]] < per/2&]; triangles = DeleteCases[Table[ sides[per], {per, 3, m}], {}] // Flatten[#, 1]& // SortBy[Total[#] m^3 + #[[1]] m^2 + #[[2]] m + #[[1]]&]; Total /@ triangles (* Jean-François Alcover, Jul 09 2017 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|