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

Home > Numbers > Sequences
Deux Difference Deduction (Posted on 2015-01-23) Difficulty: 3 of 5
Find all possible arithmetic sequences of integers, with a common difference of 2, whose sum is exactly 2016.

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 4 of 8 |
DefDbl A-Z
Dim crlf$

Function mform$(x, t$)
  a$ = Format$(x, t$)
  If Len(a$) < Len(t$) Then a$ = Space$(Len(t$) - Len(a$)) & a$
  mform$ = a$
End Function

Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents
 
 s = 2016
 For n = 1 To 6000
   a1 = (s - n * n + n) / n
   If a1 = Int(a1) Then
     Text1.Text = Text1.Text & mform(n, "####0") & " " & mform(a1, "####0") & " " & mform(a1 + 2 * n - 2, "####0") & crlf
     DoEvents
   End If
 Next
 
 Text1.Text = Text1.Text & " done"
 
End Sub

finds

 # of     1st   last
members  member member
    1     2016  2016
    2     1007  1009
    3      670   674
    4      501   507
    6      331   341
    7      282   294
    8      245   259
    9      216   232
   12      157   179
   14      131   157
   16      111   141
   18       95   129
   21       76   116
   24       61   107
   28       45    99
   32       32    94
   36       21    91
   42        7    89
   48       -5    89
   56      -19    91
   63      -30    94
   72      -43    99
   84      -59   107
   96      -74   116
  112      -93   129
  126     -109   141
  144     -129   157
  168     -155   179
  224     -214   232
  252     -243   259
  288     -280   294
  336     -329   341
  504     -499   507
  672     -668   674
 1008 -1005  1009
 2016 -2014  2016 


  Posted by Charlie on 2015-01-23 15:20:44
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
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