cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A227112 #47 Nov 12 2017 02:51:18
%S A227112 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 A227112 100,102,104,110,120,130,144,148,150,156,160,170,174,180,182,198,210,
%U A227112 224,234,240,286,290,300,312,350,360,370,390,400,440,510,520,548
%N 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.
%C A227112 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 A227112 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 A227112 The following table gives the first values (n, A, p, q).
%C A227112 +----+-----+----+----+
%C A227112 |  n |  A  |  p |  q |
%C A227112 +----+-----+----+----+
%C A227112 |  4 |   6 |  3 |  5 |
%C A227112 |  6 |  12 |  5 |  5 |
%C A227112 |  8 |  12 |  5 |  5 |
%C A227112 | 10 |  60 | 13 | 13 |
%C A227112 | 12 |  30 |  5 | 13 |
%C A227112 | 16 | 120 | 17 | 17 |
%C A227112 | 18 | 360 | 41 | 41 |
%C A227112 | 20 |  66 | 11 | 13 |
%C A227112 ...
%e A227112 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 A227112 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 A227112 Cf. A229159, A229746.
%K A227112 nonn
%O A227112 1,1
%A A227112 _Michel Lagneau_, Oct 02 2013