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

 Only 6īs and 9īs (Posted on 2005-11-14)
Look at the 3x3 grid below :
```             (3) (1) (6)
+---+---+---+
(2) | 6 | 6 | 9 |
+---+---+---+
(5) | 9 | 6 | 9 |
+---+---+---+
(4) | 9 | 6 | 6 |
+---+---+---+```
To fill it, we used only the digits 6 and 9, achieving 6 different three-digit numbers, three horizontally and three vertically. The (1) outside the second column indicates that 666 is the first number, when the six numbers are arranged in ascending order. The (4) outside of the third row indicates that 966 is the fourth number in the sequence, etc... Thus, reading the six numbers in the grid, following the sequence showed by the outside numbers, we have : 666 / 669 / 699 / 966 / 969 / 996.

Using the same rule above, fill the three 4x4 grids below (note, you can use only the digits 6 and 9 to fill each grid, and you have no restrictions on how many 6īs or how many 9īs you may use).
```       (3) (7) (6) (4)          (3) (2) (8) (5)          (2) (4) (5) (6)
+---+---+---+---+        +---+---+---+---+        +---+---+---+---+
(5) |   |   |   |   |    (1) |   |   |   |   |    (1) |   |   |   |   |
+---+---+---+---+        +---+---+---+---+        +---+---+---+---+
(2) |   |   |   |   |    (7) |   |   |   |   |    (7) |   |   |   |   |
+---+---+---+---+        +---+---+---+---+        +---+---+---+---+
(8) |   |   |   |   |    (6) |   |   |   |   |    (3) |   |   |   |   |
+---+---+---+---+        +---+---+---+---+        +---+---+---+---+
(1) |   |   |   |   |    (4) |   |   |   |   |    (8) |   |   |   |   |
+---+---+---+---+        +---+---+---+---+        +---+---+---+---+```

 See The Solution Submitted by pcbouhid Rating: 3.4000 (5 votes)

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

The three grids are:

`6996666999666666`
`6699999696966999`
`6699996969969996`

Found by variations on the following program.  The only differences are in the line that says  IF ident\$ = "r1c1r3c2c3c4r2r4" THEN.

DECLARE SUB build (n!)
CLEAR , , 25000
DIM SHARED s\$(4)

build 1

END

SUB build (n)
IF LEN(s\$(n)) < 4 THEN
s\$(n) = s\$(n) + "6"
build n
MID\$(s\$(n), LEN(s\$(n)), 1) = "9"
build n
s\$(n) = LEFT\$(s\$(n), LEN(s\$(n)) - 1)
ELSE
IF n = 4 THEN
REDIM n\$(8), id\$(8)
FOR i = 1 TO 4
n\$(i) = s\$(i)
id\$(i) = "r" + LTRIM\$(STR\$(i))
NEXT
FOR i = 1 TO 4
FOR j = 1 TO 4
n\$(i + 4) = n\$(i + 4) + MID\$(s\$(j), i, 1)
NEXT
id\$(i + 4) = "c" + LTRIM\$(STR\$(i))
NEXT
DO
flag = 0
FOR i = 1 TO 7
IF n\$(i) > n\$(i + 1) THEN
SWAP n\$(i), n\$(i + 1)
SWAP id\$(i), id\$(i + 1)
flag = 1
ELSEIF n\$(i) = n\$(i + 1) THEN flag = 2: EXIT FOR
END IF
NEXT
LOOP UNTIL flag = 0 OR flag = 2

IF flag = 0 THEN
ident\$ = id\$(1) + id\$(2) + id\$(3) + id\$(4) + id\$(5) + id\$(6) + id\$(7) + id\$(8)

IF ident\$ = "r1c1r3c2c3c4r2r4" THEN
FOR i = 1 TO 4
PRINT s\$(i)
NEXT
PRINT
END IF
END IF
ELSE
build n + 1
END IF
END IF

END SUB

 Posted by Charlie on 2005-11-14 13:33:32

 Search: Search body:
Forums (0)