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

Home > Numbers
Use all nine (Posted on 2012-06-08) Difficulty: 3 of 5
What 6-digit number ABCDEF is divisible evenly by GHI ?

Rem 1: The letters represent 9 distinct non-zero digits.
Rem 2: The digits A,B,C,D,E are in increasing order.
Rem 3: There are several solutions.

No Solution Yet Submitted by Ady TZIDON    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 2 of 3 |

FOR a = 1 TO 5
 used(a) = 1
FOR b = a + 1 TO 6
 used(b) = 1
FOR c = b + 1 TO 7
 used(c) = 1
FOR d = c + 1 TO 8
 used(d) = 1
FOR e = d + 1 TO 9
 used(e) = 1

 FOR f = 1 TO 9
   IF used(f) = 0 THEN
      used(f) = 1
      abcdef = 100000 * a + 10000 * b + 1000 * c + 100 * d + 10 * e + f

 FOR g = 1 TO 9
   IF used(g) = 0 THEN
      used(g) = 1
 FOR h = 1 TO 9
   IF used(h) = 0 THEN
      used(h) = 1
 FOR i = 1 TO 9
   IF used(i) = 0 THEN
      used(i) = 1

      ghi = 100 * g + 10 * h + i
      IF abcdef MOD ghi = 0 THEN
        PRINT abcdef, ghi, abcdef / ghi
      END IF

      used(i) = 0
   END IF
 NEXT i
      used(h) = 0
   END IF
 NEXT h
      used(g) = 0
   END IF
 NEXT g

      used(f) = 0
   END IF
 NEXT

 used(e) = 0
NEXT
 used(d) = 0
NEXT
 used(c) = 0
NEXT
 used(b) = 0
NEXT
 used(a) = 0
NEXT

produces

ABCDEF        GHI        quotient
125673        489           257
136782        459           298
147896        532           278
156784        239           656
156792        834           188
156894        237           662
246789        153           1613
256794        381           674
257891        463           557
345681        279           1239
345897        621           557
567891        243           2337
567892        134           4238

Of these, it can be noted that only 246789 has all the digits ABCDEF in order, rather than just the ABCDE required by the puzzle.


  Posted by Charlie on 2012-06-09 10:51:25
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