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

Home > Just Math
Two sums of digits (Posted on 2017-09-02) Difficulty: 2 of 5
asd+fgh=jkl

Believe me - there are numerous solutions of the above alphametic.

I. What is the minimal possible sum of participating digits?
ii. Same question for as+df=gh

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 (spoilers) | Comment 2 of 5 |
DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)
 
 minsum = 9999: minsum2 = 9999
 
 n$ = "1234567890": h$ = n
 Do
   asd = Val(Left(n, 3))
   fgh = Val(Mid(n, 4, 3))
   jkl = Val(Mid(n, 7, 3))
   tot = 45 - Val(Right(n, 1))
   If asd + fgh = jkl Then
     If tot < minsum Then minsum = tot: minsumdigs$ = Left(n, 9)
   End If
   asv = Val(Left(n, 2))
   dfv = Val(Mid(n, 3, 2))
   ghv = Val(Mid(n, 5, 2))
   tot = 0
   For i = 1 To 6
     tot = tot + Val(Mid(n, i, 1))
   Next
   If asv + dfv = ghv Then
     If tot < minsum2 Then minsum2 = tot: minsumdigs2$ = Left(n, 6)
   End If
   permute n
   DoEvents
 Loop Until n = h
 
 Text1.Text = minsum & "  " & minsumdigs & crlf
 Text1.Text = Text1.Text & minsum2 & "  " & minsumdigs2 & crlf
 
 
 Text1.Text = Text1.Text & crlf & " done"
  
End Sub


finds

36  125478603
17  132740

meaning

36 is the minimum sum, for  125 + 478 = 603
17 is the minimum sum, for 13 + 27 = 40


  Posted by Charlie on 2017-09-02 12:54:29
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 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information