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

Home > Numbers
Squares on Cubes (Posted on 2008-04-30) Difficulty: 3 of 5
I applied one of the digits 1 through 9 to each cell of the provided net of a cube.
My object was to create a unique 4 digit square number on each face. At the same time I required each vertex to be a 3 digit square. I failed in that objective!
I have 6 unique 4 digit squares but I have duplicated just one of my vertices.

To emulate my "feat":
- a [Magenta] Magenta cell is both the first digit of a 3 and 4 digit square
- an [Orange] Orange cell signifies the first digit of only a 4 digit square, while
- a [Cyan] Cyan cell signifies the first cell only of a 3 digit square.

The digits must be applied to each face by rotation, the direction is defined by need. "A" through "F" represent the 6 faces of the cube while "a" through "h" represent the vertices of the cube when fully assembled.
Note: Within the range allowed several squares utilise the same digits, and this is allowed by virtue of the commencement cell.
But then, there is still the challenge for 6 unique faces and 8 unique vertices.

See The Solution Submitted by brianjn    
Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: better classification of results | Comment 17 of 21 |
(In reply to better classification of results by Charlie)

For those interested in the program used to produce the better classification:

Dim sqr4(200), sqr3(100), had4(200), ctSol, numSqr3, vCt(100)
Private Sub cmdStart_Click()
 Open "squares on cube 7 diff.txt" For Output As #2
 Open "squares on cube 8 diff.txt" For Output As #3
 Open "squares on cube other diff.txt" For Output As #4
 FontTransparent = False
 For i = 100 To 999
  sr = Int(Sqr(i) + 0.5)
  If sr * sr = i Then
   s = LTrim(Str(i))
   If InStr(s, "0") = 0 Then
    numSqr3 = numSqr3 + 1
    sqr3(numSqr3) = s
    Print s; " ";
   End If
  End If
 Next
 Print: Print numSqr3: Print
 For i = 1000 To 9999
  sr = Int(Sqr(i) + 0.5)
  If sr * sr = i Then
   s = LTrim(Str(i))
   If InStr(s, "0") = 0 Then
    numSqr4 = numSqr4 + 1
    sqr4(numSqr4) = LTrim(Str(i))
    Print s; " ";
   End If
  End If
 Next
 Print: Print numSqr4: Print
 DoEvents
 
 For A = 1 To numSqr4
  CurrentX = 1: CurrentY = TextHeight("X") * 12
  Print A; numSqr4; ctSol: DoEvents
  had4(A) = True
  Aa = Left(sqr4(A), 1)
  For dirA = 1 To 2
   If dirA = 1 Then
    Ae = Mid(sqr4(A), 2, 1)
    Af = Mid(sqr4(A), 3, 1)
    Ab = Mid(sqr4(A), 4, 1)
   Else
    Ab = Mid(sqr4(A), 2, 1)
    Af = Mid(sqr4(A), 3, 1)
    Ae = Mid(sqr4(A), 4, 1)
   End If
   For va = 1 To numSqr3
    vCt(va) = vCt(va) + 1
    For dirVa = 1 To 2
     goodVa = True
     If Mid(sqr3(va), 2, 1) = Aa And dirVa = 1 Then
      Ba = Left(sqr3(va), 1): Ca = Right(sqr3(va), 1)
     ElseIf Mid(sqr3(va), 3, 1) = Aa And dirVa = 2 Then
      Ba = Left(sqr3(va), 1): Ca = Mid(sqr3(va), 2, 1)
     Else
      goodVa = False
     End If
     If goodVa Then
      For B = 1 To numSqr4
       If had4(B) = False Then
        For dirB = 1 To 2
         goodB = True
         If dirB = 1 And Mid(sqr4(B), 4, 1) = Ba Then
          Bd = Left(sqr4(B), 1)
          Bh = Mid(sqr4(B), 2, 1)
          Be = Mid(sqr4(B), 3, 1)
         ElseIf dirB = 2 And Mid(sqr4(B), 2, 1) = Ba Then
          Bd = Left(sqr4(B), 1)
          Bh = Mid(sqr4(B), 4, 1)
          Be = Mid(sqr4(B), 3, 1)
         Else
          goodB = False
         End If
         If goodB Then
          had4(B) = True
          For vd = 1 To numSqr3
           vCt(vd) = vCt(vd) + 1
           If Left(sqr3(vd), 1) = Bd Then
            For dirVd = 1 To 2
             If dirVd = 1 Then
              Cd = Mid(sqr3(vd), 2, 1)
              Fd = Mid(sqr3(vd), 3, 1)
             Else
              Fd = Mid(sqr3(vd), 2, 1)
              Cd = Mid(sqr3(vd), 3, 1)
             End If
             For C = 1 To numSqr4
              If had4(C) = False Then
               If Left(sqr4(C), 1) = Cd Then
                For dirC = 1 To 2
                 goodC = True
                 If dirC = 1 And Mid(sqr4(C), 2, 1) = Ca Then
                  Cb = Mid(sqr4(C), 3, 1)
                  Cc = Mid(sqr4(C), 4, 1)
                 ElseIf dirC = 2 And Mid(sqr4(C), 4, 1) = Ca Then
                  Cb = Mid(sqr4(C), 3, 1)
                  Cc = Mid(sqr4(C), 2, 1)
                 Else
                  goodC = False
                 End If
                 If goodC Then
                  had4(C) = True
                  For vertb = 1 To numSqr3
                   vCt(vertb) = vCt(vertb) + 1
                   For dirVb = 1 To 2
                    If dirVb = 1 And Mid(sqr3(vertb), 2, 2) = (Cb & Ab) Or dirVb = 2 And Mid(sqr3(vertb), 2, 2) = Ab & Cb Then
                     Db = Left(sqr3(vertb), 1)
                     For D = 1 To numSqr4
                      If Left(sqr4(D), 1) = Db And had4(D) = False Then
                       For dirD = 1 To 2
                 If dirD = 1 Then
                  Df = Mid(sqr4(D), 2, 1)
                  Dg = Mid(sqr4(D), 3, 1)
                  Dc = Mid(sqr4(D), 4, 1)
                 ElseIf dirD = 2 Then
                  Df = Mid(sqr4(D), 4, 1)
                  Dg = Mid(sqr4(D), 3, 1)
                  Dc = Mid(sqr4(D), 2, 1)
                 End If
                 had4(D) = True
                 For vc = 1 To numSqr3
                  vCt(vc) = vCt(vc) + 1
                  For dirVc = 1 To 2
                   If dirVc = 1 And Mid(sqr3(vc), 2, 2) = (Cc & Dc) Or dirVc = 2 And Mid(sqr3(vc), 2, 2) = Dc & Cc Then
                    Fc = Left(sqr3(vc), 1)
                   
                    For F = 1 To numSqr4
                     If Fc = Left(sqr4(F), 1) And had4(F) = False Then
                      had4(F) = True
                      For dirF = 1 To 2
                       goodF = True
                       If dirF = 1 And Fd = Mid(sqr4(F), 4, 1) Then
                        Fg = Mid(sqr4(F), 2, 1)
                        Fh = Mid(sqr4(F), 3, 1)
                       ElseIf dirF = 2 And Fd = Mid(sqr4(F), 2, 1) Then
                        Fg = Mid(sqr4(F), 4, 1)
                        Fh = Mid(sqr4(F), 3, 1)
                       Else
                        goodF = False
                       End If
                       If goodF Then
                       
                 For vh = 1 To numSqr3
                  vCt(vh) = vCt(vh) + 1
                  If Fh = Left(sqr3(vh), 1) Then
                    For dirVh = 1 To 2
                     goodVh = True
                     If dirVh = 1 And Mid(sqr3(vh), 3, 1) = Bh Then
                      Eh = Mid(sqr3(vh), 2, 1)
                     ElseIf dirVh = 2 And Mid(sqr3(vh), 2, 1) = Bh Then
                      Eh = Mid(sqr3(vh), 3, 1)
                     Else
                      goodVh = False
                     End If
                     If goodVh Then
                    
                                            
                 For vg = 1 To numSqr3
                  vCt(vg) = vCt(vg) + 1
                  If Fg = Left(sqr3(vg), 1) Then
                    For dirVg = 1 To 2
                     goodVg = True
                     If dirVg = 1 And Mid(sqr3(vg), 2, 1) = Dg Then
                      Eg = Mid(sqr3(vg), 3, 1)
                     ElseIf dirVg = 2 And Mid(sqr3(vg), 3, 1) = Dg Then
                      Eg = Mid(sqr3(vg), 2, 1)
                     Else
                      goodVg = False
                     End If
                     If goodVg Then
                     
                      For E = 1 To numSqr4
                       If Left(sqr4(E), 1) = Eg And had4(E) = False Then
                        For dirE = 1 To 2
                         goodE = True
                         If dirE = 1 And Eh = Mid(sqr4(E), 4, 1) Then
                          Ef = Mid(sqr4(E), 2, 1)
                          Ee = Mid(sqr4(E), 3, 1)
                         ElseIf dirE = 2 And Eh = Mid(sqr4(E), 2, 1) Then
                          Ee = Mid(sqr4(E), 3, 1)
                          Ef = Mid(sqr4(E), 4, 1)
                         Else
                          goodE = False
                         End If ' new4 E
                         If goodE Then
            '             chw = TextWidth("W"): chh = TextHeight("W")
            '             CurrentX = 4 * chw: CurrentY = 13 * chh
            '             Print Ae; "   "; Af
            '             CurrentX = 4 * chw: CurrentY = 15 * chh
            '             Print Aa; "   "; Ab
            '             CurrentX = 1 * chw: CurrentY = 17 * chh
            '             Print Be; "   "; Ba; "   "; Ca; "   "; Cb; "   "; Db; "   "; Df; "   "; Ef; "   "; Ee
            '             CurrentX = 1 * chw: CurrentY = 19 * chh
            '             Print Bh; "   "; Bd; "   "; Cd; "   "; Cc; "   "; Dc; "   "; Dg; "   "; Eg; "   "; Eh
            '             CurrentX = 4 * chw: CurrentY = 21 * chh
            '             Print Fd; "   "; Fc
            '             CurrentX = 4 * chw: CurrentY = 23 * chh
            '             Print Fh; "   "; Fg
                          DoEvents
                          ctB = ctB + 1
                          tr1 = Ef & Df & Af
                          tr2 = Ef & Af & Df
                          tr3 = Ee & Ae & Be
                          tr4 = Ee & Be & Ae
                         
                          If onList(tr1) And onList(tr3) Then
                           For ix = 1 To numSqr3
                            If sqr3(ix) = tr1 Then vf = ix
                            If sqr3(ix) = tr3 Then ve = ix
                           Next
                           GoSub reportIt
                          End If
                          If onList(tr1) And onList(tr4) Then
                           For ix = 1 To numSqr3
                            If sqr3(ix) = tr1 Then vf = ix
                            If sqr3(ix) = tr4 Then ve = ix
                           Next
                           GoSub reportIt
                          End If
                          If onList(tr2) And onList(tr3) Then
                           For ix = 1 To numSqr3
                            If sqr3(ix) = tr2 Then vf = ix
                            If sqr3(ix) = tr3 Then ve = ix
                           Next
                           GoSub reportIt
                          End If
                          If onList(tr2) And onList(tr4) Then
                           For ix = 1 To numSqr3
                            If sqr3(ix) = tr2 Then vf = ix
                            If sqr3(ix) = tr4 Then ve = ix
                           Next
                           GoSub reportIt
                          End If
                         
                         End If ' goodE
                        Next dirE
                       End If ' Eg matches
                      Next E
                      
                     End If ' goodVg
                    Next dirVg
                  End If ' Fg is first digit of vg
                  vCt(vg) = vCt(vg) - 1
                 Next vg
                      
                      
                     End If ' goodVh
                    Next dirVh
                  End If ' Fh is first digit of vh
                  vCt(vh) = vCt(vh) - 1
                 Next vh
                       
                       End If ' goodF
                      Next dirF
                      had4(F) = False
                     End If ' Fc matches
                    Next F
                   
                   End If ' good dirVc
                  Next dirVc
                  vCt(vc) = vCt(vc) - 1
                 Next vc
                 had4(D) = False
                       Next dirD
                      End If ' D begins with Db
                     Next D
                    End If ' good vertb
                   Next dirVb
                   vCt(vertb) = vCt(vertb) - 1
                  Next vertb
                  had4(C) = False
                 End If ' goodC
                Next dirC
               End If ' C fits Cd
              End If 'had4(C) false
             Next C
            Next
           End If ' sqr3(vd) begins with Bd
           vCt(vd) = vCt(vd) - 1
          Next vd
          had4(B) = False
         End If ' goodB
        Next dirB
       End If ' had4(B)=false
      Next B
     End If ' goodVa
    Next dirVa
    vCt(va) = vCt(va) - 1

   Next va
  Next dirA
  had4(A) = False
 Next A
 Print "end"; ctSol
 Close
 Exit Sub
 
 
reportIt:
    vCt(vf) = vCt(vf) + 1
    vCt(ve) = vCt(ve) + 1
   
    nCtTot = 0
    For ix = 1 To numSqr3
     If vCt(ix) > 0 Then nCtTot = nCtTot + 1
    Next
    If nCtTot = 7 Then
      fNo = 2
    ElseIf nCtTot = 8 Then
      fNo = 3
    Else
      fNo = 4
    End If
   
   
    Print #fNo, "   "; Ae; Af
    Print #fNo, "   "; Aa; Ab
    Print #fNo, Be; Ba; " "; Ca; Cb; " "; Db; Df; " "; Ef; Ee
    Print #fNo, Bh; Bd; " "; Cd; Cc; " "; Dc; Dg; " "; Eg; Eh
    Print #fNo, "   "; Fd; Fc
    Print #fNo, "   "; Fh; Fg
    Print #fNo, sqr4(A); " "; sqr4(B); " "; sqr4(C); " "; sqr4(D); " "; sqr4(E); " "; sqr4(F)
    Print #fNo, sqr3(va); " "; sqr3(vertb); " "; sqr3(vc); " "; sqr3(vd); " "; sqr3(ve); " "; sqr3(vf); " "; sqr3(vg); " "; sqr3(vh)
    For iCtr = 1 To numSqr3
     If vCt(iCtr) > 0 Then
       Print #fNo, sqr3(iCtr); vCt(iCtr); "   ";
     End If
    Next
    Print #fNo,: Print #fNo,: Print #fNo,
    ctSol = ctSol + 1
    vCt(vf) = vCt(vf) - 1
    vCt(ve) = vCt(ve) - 1
Return
End Sub
Function onList(s)
 For i = 1 To numSqr3
  If s = sqr3(i) Then onList = True: Exit Function
 Next
 onList = False
End Function


  Posted by Charlie on 2008-05-03 10:05: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 (8)
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