I hate doing a lot of algebra (although this reminds me of Heron's formula.)
anyway, the answer is 6^3 = 216
ia ib ic -6 6 6 216.000000
ia ib ic 6 -6 6 216.000000
ia ib ic 6 6 -6 216.000000
program abc
implicit none
integer ia,ib,ic
real a,b,c,lh1,rh1,lh2,cube
do ia=-1000,1000
do ib=-1000,1000
a=ia
b=ib
c=6-(ia+ib)
ic=c
lh2=a**2/(b*c)+b**2/(c*a)+c**2/(a*b)+a*b/c**2+b*c/a**2+c*a/b**2
if (lh2.ne.-2.)go to 1
lh1=(a-b)/c+(b-c)/a+(c-a)/b
rh1=(1+a/b)*(1+b/c)*(1+c/a)
if(lh1.ne.rh1)go to 1
c print*,lh1,lh2,rh1,
cube=ia**3+ib**3+ic**3
print*,'ia ib ic ',ia,ib,ic, cube
1 enddo
2 enddo
end
Edited on June 28, 2019, 7:31 pm