All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
All possible integer determination (Posted on 2015-06-20) Difficulty: 3 of 5
Find all possible integers P, Q, R and S with 1 ≤ P ≤ Q ≤ R ≤ S satisfying this equation:
PQ+RS = P+Q+R+S+3

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1
p q r s    lhs & rhs
1 1 2 6     13
2 2 3 3     13
1 2 2 6     14
2 2 2 5     14

DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)

 For tot = 3 To 1000
   For p = 1 To tot / 4
   For q = p To (tot - p) / 3
   For r = q To (tot - p - q) / 2
     s = tot - p - q - r
     If p * q + r * s = p + q + r + s + 3 Then
      Text1.Text = Text1.Text & p & Str(q) & Str(r) & Str(s) & "     " & p * q + r * s & crlf
      DoEvents
     End If
   Next
   Next
   Next
 
 Next
 
 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub


  Posted by Charlie on 2015-06-20 14:44:33
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information