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

Home > Numbers
Octo Vertices (Posted on 2008-12-30) Difficulty: 3 of 5
In the following octahedral net the vertices A, B, C, D, E and F, and are to be assigned distinctive values from 1 through 9.


M, N, O, P, Q, R, S and T are the values of the respective sums of the three vertices which form the respective surfaces to which each is assigned.

M + N = O + P = Q + R = S + T

Find unique sets of values1 for A, B, C, D, E and F such that the values of M through T (but not necessarily in that order) form series which increment by 2 of which there are 7.
Background statistics:
                                   Unique        Actual
                M+N=   Interval     Sets2       Solutions
                 21       1           1            96
                 23       1           2            96
                 25       1           2            96
                 26       2           2            96
                 27       1           5           480
                 29       1           4           288 
                 30       2           3           144
                 31       1           8           288
                 33       1           6           480
                 34       2           2            96
                 35       1           2            96
                 37       1           2            96
                 39       1           1            96
                                     40          2448 

Note:
1. For M+N=21,
          1, 2, 3, 6, 4, 5
          1, 2, 3, 6, 5, 4
      and 1, 2, 5, 3, 4, 6  
   are the first 3 of 96 solutions.  The 96 values do not
   discriminate amongst vertex rotation or reflections. 
2. Each unique set configures the octahedron in more ways than one.

  Submitted by brianjn    
No Rating
Solution: (Hide)
 M+N   A B C D E F
 26    1 2 9 4 3 7
 26    1 2 9 6 3 5
 30    1 2 9 6 5 7
 30    1 3 9 5 4 8
 30    1 4 9 6 3 7
 34    1 3 9 7 6 8
 34    1 4 9 8 5 7
The following program generates all of the data noted in the background statistics summary.
DECLARE SUB keyin ()
DECLARE SUB validate ()
DECLARE SUB order ()
DIM SHARED sum(10)
DIM SHARED a, b, c, d, e, f
DIM SHARED m, n, o, p, q, r, s, t
DIM SHARED line1$, line2$, line3$, line4$
DIM SHARED interval
DIM SHARED count
count = 1
'line1$ = ""

OPEN "octo.txt" FOR OUTPUT AS #1

CLS
FOR a = 1 TO 9
FOR b = 1 TO 9
FOR c = 1 TO 9
FOR d = 1 TO 9
FOR e = 1 TO 9
FOR f = 1 TO 9
'-----------------------------------------------
REM Isolate when a,b,c,d,e and f have unique 
values in relation to each other
'-----------------------------------------------
IF (e <> f AND d <> e AND d <> f AND c <> d AND c <> e AND c <> f 
  AND b <> c AND b <> d AND b <> e AND b <> f AND a <> b AND a <> c 
  AND a <> d AND a <> e AND a <> f) THEN
line1$ = STR$(a) + STR$(b) + STR$(c) + STR$(d) 
           + STR$(e) + STR$(f) + "   "
'--------------
REM Vertex sums
'--------------
m = c + d + f: n = a + b + e: o = b + c + f: p = a + d + e
q = a + b + f: r = c + d + e: s = a + d + f: t = b + c + e

line2$ = line1$ + STR$(m) + STR$(n) + STR$(o) + STR$(p) + STR$(q) 
      + STR$(r) + STR$(s) + STR$(t) + "   "
'--------------------------------
REM  Map vertex sums to the array
'--------------------------------
sum(0) = m: sum(1) = n: sum(2) = o: sum(3) = p
sum(4) = q: sum(5) = r: sum(6) = s: sum(7) = t

  order        'REM Routine reorders the array in ascending values
  validate     'REM Routine only accepts and saves sequences which
                REM  have A.P. intervals of either 1 or 2.
END IF

NEXT: NEXT: NEXT: NEXT: NEXT: NEXT

CLOSE 1

SUB keyin
DO
LOOP WHILE INKEY$ <> CHR$(32)
END SUB

SUB order
FOR i = 0 TO 6
   FOR j = i + 1 TO 7
      IF sum(i) > sum(j) THEN
          y = sum(i)
          sum(i) = sum(j)
          sum(j) = y
    END IF
NEXT: NEXT

 line3$ = ""
    FOR x = 0 TO 7
       line3$ = line3$ + STR$(sum(x))
    NEXT

END SUB

SUB validate

line4$ = line2$ + line3$

interval = 1
s = 0
'-------------------------------
REM  Test for A.P. interval of 1
'-------------------------------
DO
    s = s + 1
    IF sum(s + 1) - sum(s) <> 1 THEN
       interval = 0
    END IF
LOOP WHILE (interval = 1 AND s <= 5)
'-------------------------------
REM  Test for A.P. interval of 2
'-------------------------------
IF interval = 0 THEN
   s = 0
   interval = 1
       DO
         s = s + 1
         IF sum(s + 1) - sum(s) <> 2 THEN
             interval = 0
         END IF
       LOOP WHILE (interval = 1 AND s <= 5)
END IF
'------------------------
REM   Save valid results
'------------------------
IF interval = 1 THEN
    PRINT "Count"; count; m + n; "Line4$"; line4$
    line4$ = STR$(count) + "  " + STR$(m + n) + "  " + line4$
    PRINT #1, line4$
    count = count + 1
   ' keyin
END IF

END SUB

Comments: ( You must be logged in to post comments.)
  Subject Author Date
re: computer solutionbrianjn2008-12-31 22:23:10
Solutioncomputer solutionCharlie2008-12-30 17:45:22
A wee start analyticallyrod hines2008-12-30 17:41:36
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 (19)
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