login
A334818
Integers whose square root is the longest side of a non-right triangle whose side lengths are also square roots of integers, and with integer area.
7
5, 8, 9, 10, 13, 15, 16, 17, 18, 20, 24, 25, 26, 27, 29, 30, 32, 34, 35, 36, 37, 39, 40, 41, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 60, 61, 63, 64, 65, 68, 70, 72, 73, 74, 75, 78, 80, 81, 82, 85, 87, 88, 89, 90, 91, 95, 96, 97, 98, 99, 100, 101, 102
OFFSET
1,1
COMMENTS
Equivalent to finding all integer triples (a,b,c) such that sqrt(4*a*b-(a+b-c)^2) is an integer multiple of 4.
All Pythagorean triples satisfy this criterion; if (a,b,c) is a Pythagorean triple then a and b cannot be odd, so the triangle has integer area.
If m is in the list, so is 4m.
LINKS
EXAMPLE
The triangle with side lengths sqrt(8), sqrt(9) and sqrt(29) has area 3 and is not a right triangle, so 29 is in the list.
The triangle with side lengths sqrt(53), sqrt(65) and sqrt(72) has area 27 and is not a right triangle, so 72 is in the list.
MATHEMATICA
ok[c_] := Catch[ Do[ If[ a+b != c && 4 a b > (c-a-b)^2 && IntegerQ[ Sqrt[2 a (b+c) - a^2 - (b-c)^2]/4], Throw@ True], {a, c}, {b, a}]; False]; Select[ Range@ 96, ok] (* Giovanni Resta, May 13 2020 *)
PROG
(Python)
import numpy as np
import math
def is_square(n):
return math.isqrt(n) ** 2 == n
def is_valid_triangle(a, b, c):
return ((a + b) > c) and ((b + c) > a) and ((a + c) > b)
def aList(upto): # Number to check up to
my_list = []
for i in range(upto):
sqrti = np.sqrt(i)
for j in range(i + 1):
sqrtj = np.sqrt(j)
for k in range(i + 1):
sqrtk = np.sqrt(k)
if is_valid_triangle(sqrti, sqrtj, sqrtk):
test = 4 * i * j - (i + j - k) ** 2
if is_square(test) and test % 16 == 0 and (i != j + k):
my_list.append(i)
return list(set(my_list))
print(aList(103))
CROSSREFS
Sequence in context: A348046 A371656 A323215 * A337215 A314571 A191977
KEYWORD
nonn
AUTHOR
Samuel Bodansky, May 12 2020
STATUS
approved