Originally posted by Lior
Hi,

I would wanna know how to be able to find groups of numbers who are valid groups for the known pythagoras theorem (a^2+b^2=c^2)

I mean, how can I represent A, B, and C with a general variable, let's say n.

so:

A = something with n
B = something with n
C = something with n

so A^2+B^2=C^2

therefore, when I know the number A, I can know also the numbers B and C

of course that in this way, B and C would be only one option for making a group with A.

I hope I made myself clear, sorry, that's my poor english level so far.

btw heres some VB code that'll do that for you. Make a multiline textbox with a scroll bar, and add this to a button:

VB Code:
  1. Dim A As Long
  2.     Dim B As Long
  3.     Dim D As Long
  4.     Dim N As Long
  5.     Dim M As Long
  6.    
  7.     For M = 1 To 1000
  8.         N = M + 1
  9.         A = Sqr(N) - Sqr(M)
  10.         B = 2 * N * M
  11.         c = Sqr(N) + Sqr(M)
  12.         Text1 = Text1 & A & "²" & vbTab & B & "²" & vbTab & "= " & c & "²" & vbCrLf
  13.     Next
I just applied the formula.