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

Home > Numbers
Add'em all ! (Posted on 2017-07-27) Difficulty: 4 of 5
The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property:

d2d3d4=406 is divisible by 2
d3d4d5=063 is divisible by 3
d4d5d6=635 is divisible by 5
d5d6d7=357 is divisible by 7
d6d7d8=572 is divisible by 11
d7d8d9=728 is divisible by 13
d8d9d10=289 is divisible by 17

Find the sum of all 0 to 9 pandigital numbers with this property.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution (spoiler) | Comment 1 of 3
The numbers and their total:

 1406357289
 1430952867
 1460357289
 4106357289
 4130952867
 4160357289
-----------
16695334890  

DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 s$ = "0123456789": h$ = s
 Do
   If Val(Mid(s, 2, 3)) Mod 2 = 0 Then
   If Val(Mid(s, 3, 3)) Mod 3 = 0 Then
   If Val(Mid(s, 4, 3)) Mod 5 = 0 Then
   If Val(Mid(s, 5, 3)) Mod 7 = 0 Then
   If Val(Mid(s, 6, 3)) Mod 11 = 0 Then
   If Val(Mid(s, 7, 3)) Mod 13 = 0 Then
   If Val(Mid(s, 8, 3)) Mod 17 = 0 Then
     Text1.Text = Text1.Text & s & crlf
     tot = tot + Val(s)
   End If
   End If
   End If
   End If
   End If
   End If
   End If
   permute s
   DoEvents
 Loop Until s = h
 
 Text1.Text = Text1.Text & crlf & tot & " done"
  
End Sub

  Posted by Charlie on 2017-07-27 10:30:14
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 (3)
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