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

Home > Numbers
Only 2 answers (Posted on 2015-08-26) Difficulty: 2 of 5
Using each of the digits 1, 2, 3, and 4 twice, write out an eight-digit number in which there is one digit between the 1s, two digits between the 2s,
three digits between the 3s, and four digits between the 4s.

Credit: A. Savin

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 | Comment 1 of 3
23421314
41312432

DefDbl A-Z
Dim crlf$


Private Sub Form_Load()
 Form1.Visible = True
 
 Text1.Text = ""
 crlf = Chr$(13) + Chr$(10)

 s$ = "11223344"
 h$ = s
 Do
   ix1 = InStr(s, "4")
   ix2 = InStr(ix1 + 1, s, "4")
   If ix2 = ix1 + 5 Then
     ix1 = InStr(s, "3")
     ix2 = InStr(ix1 + 1, s, "3")
     If ix2 = ix1 + 4 Then
   ix1 = InStr(s, "2")
   ix2 = InStr(ix1 + 1, s, "2")
   If ix2 = ix1 + 3 Then
     ix1 = InStr(s, "1")
     ix2 = InStr(ix1 + 1, s, "1")
     If ix2 = ix1 + 2 Then
       Text1.Text = Text1.Text & s & crlf
     End If
   End If
     End If
   End If
   permute s
 Loop Until s = h


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


  Posted by Charlie on 2015-08-26 11:17:03
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