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

Home > Numbers
Divisibility in a sequence (Posted on 2017-08-12) Difficulty: 3 of 5
Show that in every sequence of 79 consecutive positive integers, there is a positive integer whose sum of digits is divisible by 13.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution proof (but not a proof that this is the lowest achievable) | Comment 1 of 2
The table below lists in a 13x13 array (plus an attached row-identifying column at the left) a set of entries in the format of:

difference between members of the sequence, initial member of the sequence, and following member.

The calculations were done for a span of 200, so as to take into consideration the triggering of a change in the higher order digits of larger-numbered sequences.  The rows represent how much the mod-13 value of the total higher-order digits is for the particular triggering (overflow), and that is the label in the leftmost column.  Identifying start and end values are below 100 for those without the addition of the triggered change and those 100 and above represent the changed values from higher order digits, not necessarily a change of 1 (in fact that's the row labelled 1), so the hundreds digit of 1 merely represents a jump of some sort in the higher order digit from one century to the next.

The largest difference found was indeed 79, found in row 7, taking place when, for one value the last two digits are 60 and for the next value the last two digits are 39, and the overflow has resulted in a change of 7 in the mod-13 value of the higher order digits.

While this proves what was intended, that no larger gap than 79 (well, the gap is 78, but the 79 is necessary to insure inclusion of one of the multiples) exists between sod's divisible by 13, it does not prove that such an example exists, where the last two digits of the first end in 60, the sod of the overall number is divisible by 13, and the next number with such a divisibility ends in 39, with the mod-13 value remaining at 0 due to a change of 7 in the higher-order digit's mod-13 value. If this indeed is true, there must be more steps in a proof.

 0  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   46  60-106   37  70-107   28  80-108   19  90-109   28  91-119   37  92-129   46  93-139  

 1  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 150-199   36  70-106   27  80-107   18  90-108   18  91-109   27  92-119   36  93-129  

 2  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 140-189   49 150-199   26  80-106   17  90-107   17  91-108   17  92-109   26  93-119  

 3  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 130-179   49 140-189   49 150-199   16  90-106   16  91-107   16  92-108   16  93-109  

 4  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 120-169   49 130-179   49 140-189   49 150-199   15  91-106   15  92-107   15  93-108  

 5  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 110-159   49 120-169   49 130-179   49 140-189   49 150-199   14  92-106   14  93-107  

 6  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 100-149   49 110-159   49 120-169   49 130-179   49 140-189   49 150-199   13  93-106  

 7  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   79  60-139   49 100-149   49 110-159   49 120-169   49 130-179   49 140-189   49 150-199  

 8  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   69  60-129   69  70-139   49 100-149   49 110-159   49 120-169   49 130-179   49 140-189  

 9  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   59  60-119   59  70-129   59  80-139   49 100-149   49 110-159   49 120-169   49 130-179  

10  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 150-199   36  70-106   27  80-107   18  90-108   18  91-109   27  92-119   36  93-129  

11  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 140-189   49 150-199   26  80-106   17  90-107   17  91-108   17  92-109   26  93-119  

12  49   0-49   49  10-59   49  20-69   49  30-79   49  40-89   49  50-99   49 130-179   49 140-189   49 150-199   16  90-106   16  91-107   16  92-108   16  93-109  


79

DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 For outside = 0 To 12
 ReDim had(12), last(12), largeDiff(12, 2)
 For n = 0 To 199
   m100 = n Mod 100
   If n > 99 Then
     m13 = (sod(m100) + sod(outside)) Mod 13
   Else
     m13 = sod(n) Mod 13
   End If
   
   If had(m13) Then
     diff = n - last(m13)
     If diff > largeDiff(m13, 0) Then
       largeDiff(m13, 0) = diff
       largeDiff(m13, 1) = last(m13)
       largeDiff(m13, 2) = n
       If diff > largestDiff Then largestDiff = diff
     End If
   End If
   had(m13) = 1
   last(m13) = n
   DoEvents
 Next n
 Text1.Text = Text1.Text & mform(outside, "#0") & " "
 For j = 0 To 12
     Text1.Text = Text1.Text & mform(largeDiff(j, 0), "##0")
     Text1.Text = Text1.Text & mform(largeDiff(j, 1), "###0") & "-"
     Text1.Text = Text1.Text & largeDiff(j, 2) & "  "
     DoEvents
 Next
 Text1.Text = Text1.Text & crlf & crlf
 Next outside

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

Function sod(n)
  s$ = LTrim(Str(n))
  tot = 0
  For i = 1 To Len(s$)
   tot = tot + Val(Mid(s$, i, 1))
  Next
  sod = tot
End Function

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


  Posted by Charlie on 2017-08-12 11:42:49
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 (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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