Sub main()
Dim a%, i%, b%, n%
Debug.Print "there are following friendly-numbers pair smaller than 3000:"
For a = 1 To 2999
b = 0
For i = 1 To a / 2
If a Mod i = 0 Then b = b + i
Next
n = 0
For i = 1 To b / 2
If b Mod i = 0 Then n = n + i
Next
If (n = a And a < b) Then Debug.Print a; " .. "; b
Next
End Sub