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

Home > Numbers
Digital computing (Posted on 2019-08-03) Difficulty: 3 of 5
I added two three-digit numbers a and b, where the six digits I used to write a and b were all different. a + b was another three-digit number. I added the digits in a and b to obtain another number n.

What can you say about n?

No Solution Yet Submitted by Danish Ahmed Khan    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution--I think what's wanted | Comment 1 of 25
DefDbl A-Z
Dim had(60), crlf$
Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 
 For a1 = 1 To 9
  astr$ = LTrim(Str(a1))
  For a2 = 0 To 9
   a2str$ = LTrim(Str(a2))
   If InStr(astr, a2str) = 0 Then
    astr = astr + a2str
  For a3 = 0 To 9
   a3str$ = LTrim(Str(a3))
   If InStr(astr, a3str) = 0 Then
    astr = astr + a3str
  For b1 = 1 To 9
   b1str$ = LTrim(Str(b1))
   If InStr(astr, b1str) = 0 Then
    bstr$ = b1str
  For b2 = 0 To 9
   b2str$ = LTrim(Str(b2))
   If InStr(astr + bstr, b2str) = 0 Then
    bstr = bstr + b2str
  For b3 = 0 To 9
   b3str$ = LTrim(Str(b3))
   If InStr(astr + bstr, b3str) = 0 Then
    bstr = bstr + b3str
    
    If Val(astr) + Val(bstr) <= 999 Then
       tot = 0: ab$ = astr + bstr
       For i = 1 To 6
         tot = tot + Val(Mid(ab, i, 1))
       Next
       had(tot) = 1
    End If
    
    DoEvents
    
   End If
  Next
   End If
  Next
   End If
  Next
   End If
  Next
  End If
  Next
 Next
 
 For i = 1 To 60
   If had(i) Then Text1.Text = Text1.Text & Str(i)
 Next
  
  Text1.Text = Text1.Text & crlf & " done"
  DoEvents

End Sub

Finds that  n must be 15, 16, 17 or 18.

  Posted by Charlie on 2019-08-03 13:01:15
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 (6)
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