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

Home > Just Math
List of pairs (Posted on 2015-12-04) Difficulty: 2 of 5
There are infinitely many ordered pairs (m,n) of positive integers for which
m + (m+1) + (m+2) + ... (n-1) + n = mn.

List the first five pairs ordered by values of m.

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution -- first eight pairs | Comment 1 of 3
(2m+(n-m))/2 * (n-m+1) = nm

(m+n)(n-m+1) = 2nm

mn - m^2 + m + n^2 - nm + n = 2nm

n^2 - m^2 + m + n - 2nm = 0

n^2 + (1-2m)n + m - m^2 = 0

so

DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 For m = 1 To 100000
   b = 1 - 2 * m
   c = m - m * m
   det = b * b - 4 * c
   If det >= 0 Then
     s1 = (-b - Sqr(det)) / 2
     s2 = (-b + Sqr(det)) / 2
     If s1 > 0 And Abs(s1 - Int(s1)) < 0.000001 Then
       Text1.Text = Text1.Text & m & Str(s1) & crlf
     End If
     If s2 > 0 And Abs(s2 - Int(s2)) < 0.000001 Then
       Text1.Text = Text1.Text & m & Str(s2) & crlf
     End If
   End If
 Next


 Text1.Text = Text1.Text & crlf & " done"
  
End Sub

producing these first eight pairs:

1 1
3 6
15 35
85 204
493 1189
2871 6930
16731 40391
97513 235416

  Posted by Charlie on 2015-12-04 11:27:37
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 (10)
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