login
Numbers n such that there exist two primes p and q where the area A of the triangle of sides (n, p, q) is an integer.
0

%I #47 Nov 12 2017 02:51:18

%S 4,6,8,10,12,16,18,20,22,24,26,30,38,40,42,50,56,60,68,70,78,80,90,96,

%T 100,102,104,110,120,130,144,148,150,156,160,170,174,180,182,198,210,

%U 224,234,240,286,290,300,312,350,360,370,390,400,440,510,520,548

%N Numbers n such that there exist two primes p and q where the area A of the triangle of sides (n, p, q) is an integer.

%C n is an even composite number because the perimeter of the triangle (n, p, q) is always even. The corresponding areas are {6, 12, 12, 60, 30, 120, 360, 66, ...}

%C The area is given by Heron's formula A = sqrt(s(s-n)(s-p)(s-q)) where the semiperimeter s = (n + p + q)/2.

%C The following table gives the first values (n, A, p, q).

%C +----+-----+----+----+

%C | n | A | p | q |

%C +----+-----+----+----+

%C | 4 | 6 | 3 | 5 |

%C | 6 | 12 | 5 | 5 |

%C | 8 | 12 | 5 | 5 |

%C | 10 | 60 | 13 | 13 |

%C | 12 | 30 | 5 | 13 |

%C | 16 | 120 | 17 | 17 |

%C | 18 | 360 | 41 | 41 |

%C | 20 | 66 | 11 | 13 |

%C ...

%e 12 is in the sequence because the triangle (12, 5, 13) => semiperimeter s = (12+5+13)/2 = 15, and A = sqrt(15*(15-12)*(15-5)*(15-13))= 30, with 5 and 13 prime numbers.

%t area[a_, b_, c_] := Module[{s = (a + b + c)/2, a2}, a2 = s (s - a) (s - b) (s - c); If[a2 < 0, 0, Sqrt[a2]]]; goodQ[a_, b_, c_] := Module[{ar = area[a, b, c]}, ar > 0 && IntegerQ[ar]]; nn = 300; t = {}; ps = Prime[Range[2, nn]]; mx = 3*ps[[-1]]; Do[If[p <= q && goodQ[p, q, e], aa = area[p, q, e]; If[aa <= mx, AppendTo[t, e]]], {p, ps}, {q, ps}, {e, q - p + 2, p + q - 2, 2}]; t = Union[t] (* program from _T. D. Noe_ adapted for this sequence - see A229746 *)

%Y Cf. A229159, A229746.

%K nonn

%O 1,1

%A _Michel Lagneau_, Oct 02 2013