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

Home > Numbers
Metadivisible (Posted on 2007-11-09) Difficulty: 3 of 5
Arrange the digits 1 through 9 into a 3x3 grid as described below:

The digits form three 3-digit numbers reading left-to-right, and three 3-digit numbers reading top-to-bottom. Also consider these six 3-digit numbers reversed, that is, reading right-to-left and bottom-to-top.

For each of those nine digits, d, you count how many of the twelve 3-digit numbers are divisible by the number d. In the case of each d, that number, the count, is itself divisible by d.

How are the numbers arranged, with the understanding that rotations and reflections of that arrangement are possible alternatives?

  Submitted by Charlie    
Rating: 3.6667 (3 votes)
Solution: (Hide)

164
758
932 

and its rotations and reflections.

The numbers are

 164 758 932 179 653 482 461 857 239 971 356 284

Six of these are divisible by 2 and four are divisible by 4. Zero are divisible by 3, 5, 6, 7, 8 or 9. Of course all twelve are divisible by 1.

DECLARE SUB permute (a$)
DIM n(12)
CLS
s$ = "123456789": h$ = s$
DO
  n(1) = VAL(LEFT$(s$, 3))
  n(2) = VAL(MID$(s$, 4, 3))
  n(3) = VAL(RIGHT$(s$, 3))
  n(4) = VAL(MID$(s$, 1, 1) + MID$(s$, 4, 1) + MID$(s$, 7, 1))
  n(5) = VAL(MID$(s$, 2, 1) + MID$(s$, 5, 1) + MID$(s$, 8, 1))
  n(6) = VAL(MID$(s$, 3, 1) + MID$(s$, 6, 1) + MID$(s$, 9, 1))
  FOR i = 1 TO 6
   nm$ = LTRIM$(STR$(n(i)))
   n0 = 0
   FOR j = 3 TO 1 STEP -1
     n0 = n0 * 10 + VAL(MID$(nm$, j, 1))
   NEXT
   n(i + 6) = n0
  NEXT i
  
  good = 1
  FOR div = 2 TO 9
   t = 0
   FOR i = 1 TO 12
    r = n(i) MOD div
    IF r = 0 THEN t = t + 1
   NEXT
   r = t MOD div
   IF r > 0 THEN good = 0: EXIT FOR
  NEXT
  IF good THEN
    FOR i = 1 TO 12
     PRINT USING " ###"; n(i);
    NEXT
    PRINT 
    FOR div = 2 TO 9
     t = 0
     FOR i = 1 TO 12
      r = n(i) MOD div
      IF r = 0 THEN t = t + 1
     NEXT
     PRINT t;
    NEXT
    PRINT
    PRINT MID$(s$, 1, 3)
    PRINT MID$(s$, 4, 3)
    PRINT MID$(s$, 7, 3)
    PRINT
  END IF
 
  permute s$
LOOP UNTIL s$ = h$

which produces

 164 758 932 179 653 482 461 857 239 971 356 284 
  6  0  4  0  0  0  0  0
164
758
932

 179 653 482 164 758 932 971 356 284 461 857 239 
  6  0  4  0  0  0  0  0
179
653
482

 239 857 461 284 356 971 932 758 164 482 653 179 
  6  0  4  0  0  0  0  0
239
857
461

 284 356 971 239 857 461 482 653 179 932 758 164 
  6  0  4  0  0  0  0  0
284
356
971

 461 857 239 482 653 179 164 758 932 284 356 971 
  6  0  4  0  0  0  0  0
461
857
239

 482 653 179 461 857 239 284 356 971 164 758 932 
  6  0  4  0  0  0  0  0
482
653
179

 932 758 164 971 356 284 239 857 461 179 653 482 
  6  0  4  0  0  0  0  0
932
758
164

 971 356 284 932 758 164 179 653 482 239 857 461 
  6  0  4  0  0  0  0  0
971
356
284

showing all rotations and reflections, with the numbers and the number of divisibilities by 2 through 9.

From Enigma No. 1463 by Susan Denham, New Scientist, 6 October 2007.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Some ThoughtsPuzzle ThoughtsK Sengupta2022-07-30 22:08:22
Hints/Tips A mid sized step for man..FrankM2008-01-21 00:50:47
Partial Solution (spoiler)Dej Mar2007-11-09 16:29:20
Some ThoughtsA startLeming2007-11-09 14:29:06
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