Wednesday, October 6, 2010

Pythagorian triple distribution





t=-1
clg
for c=3 to 3000
for b=2 to c-1
asquared=c^2-b^2
a=(asquared)^.5
if a=int(a)then
t=t*(-1)
if t=-1 then print a+chr(178)+"+"+b+chr(178)+"="+c+chr(178)
if a<3000 and b<3000 then plot a/10,b/10
end if
next b

next c

No comments:

Post a Comment