A227112 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.
4, 6, 8, 10, 12, 16, 18, 20, 22, 24, 26, 30, 38, 40, 42, 50, 56, 60, 68, 70, 78, 80, 90, 96, 100, 102, 104, 110, 120, 130, 144, 148, 150, 156, 160, 170, 174, 180, 182, 198, 210, 224, 234, 240, 286, 290, 300, 312, 350, 360, 370, 390, 400, 440, 510, 520, 548
Offset: 1
Keywords
Examples
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.
Programs
-
Mathematica
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 *)
Comments