Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USSR puzzle digital
#3
OHHHHHHHHHHHHHHHH ! I thought the 9 digits had to be a unique permutation of digits 1 to 9. Well there aren't any of those BUT!

There are 65 sets that match e(2) with e(3) and with e(5) (Danilins = 8 equations) some get pretty close to single digit answers to all 6 equations. 

There are 5 of the closest = 9 not 8 in e2, e3 and e5.

How I found these as alternate to Danilin's problem:

First I created a file of the permutations of digits 1 to 9:
Code: (Select All)
_Title "Recursive 9 Permutations of symbols to RA" 'mod B+ 2026-02-27

'ordered permutations.bas for SmallBASIC 0.12.6 [B+=MGA] 2016-07-21
'translated from JB v1.01 [B+=MGA] 2016-07-21
'recursive ordered permutations (non repeating)
'if 1st element < 2nd element < 3rd element... then list acsends
'if reverse case then list decsends
' 2026-02-27 this mod

Dim Shared ls, index
Dim Shared record As String * 9
s$ = "987654321"
ls = Len(s$)
index = 0
Dim Shared c$(ls) 'this holds each letter or digit or symbol
Open "9 permutations.RA" For Random As #1 Len = 9
perm s$ '<<<<<<<<<<<<< if s$ is ordered then the permutations will be so also!!!

Sub perm (r$)
    'local lr, i, r1
    If Len(r$) = 0 Then
        index = index + 1
        b$ = ""
        For i = 1 To ls
            b$ = b$ + c$(i)
        Next
        record = b$
        Put #1, index, record
    Else
        lr = Len(r$)
        For i = 1 To lr
            c$(ls - lr + 1) = Mid$(r$, i, 1)
            If i < Len(r$) And i > 1 Then
                r1$ = Mid$(r$, 1, i - 1) + Mid$(r$, i + 1)
                'ELSEIF i = 1 AND i = lr THEN
                'r1$ = ""
            ElseIf i = 1 Then
                r1$ = Mid$(r$, i + 1)
            Else
                r1$ = Mid$(r$, 1, i - 1)
            End If
            perm r1$
        Next
    End If
End Sub

Then I checked all permutations with this code:
Code: (Select All)
_Title "Test Danlin's matrix with 9 permutations" 'b+  2026-02-26
' 2026-02-27 rewrite for RA
Dim record As String * 9
Open "9 permutations.RA" For Random As #1 Len = 9
Dim c(1 To 9) As Integer, index As Long
While index < 362880
    index = index + 1
    Get #1, index, record
    Print index; ":"; record

    For i = 1 To 9
        c(i) = Val(Mid$(record, i, 1))
    Next
    If c(1) * c(2) - c(3) = 4 Then
        Print "Check First equation: "; record
        'Sleep
        If c(4) + c(5) + c(6) = 8 Then
            Print "Check 2nd equation: "; record
            'Sleep
            If c(7) / c(8) + c(9) = 8 Then
                Print "Check 3rd equation: "; record
                Sleep
                If c(1) / c(4) + c(7) = 9 Then
                    If c(2) + c(5) + c(8) = 8 Then
                        If c(3) + c(6) - c(9) = 6 Then
                            Print "!!!!!!!!!!!!!!!!!!!!Solution! "; c(1), c(2), c(3)
                            Print "!!!!!!!!!!!!!!!!!!!!Solution! "; c(4), c(5), c(6)
                            Print "!!!!!!!!!!!!!!!!!!!!Solution! "; c(7), c(8), c(9)
                            Sleep
                            End
                        End If
                    End If
                End If
            End If
        End If
    End If
Wend

Nope! Nothing stopped and met Danilins 4, 8, 8, 9, 8, 6 answers so there is NOT 9 unique digits that solve Danilin's equations.

So how close can we get? 
First I tried to just match e2, e3, and e5 and there I found 65 solutions!

So what combinations get us closest to e2=e3=e5 = 8?
How about e2 = e3 = e5 = 9 !

Yes only 5 of those:
Code: (Select All)
index, record is 10546      968315427     e()'s match #1
9  * 6  - 8  = 46
3  + 1  + 5  = 9
4  / 2  + 7  = 9
9  / 3  + 4  = 7
6  + 1  + 2  = 9
8  + 5  - 7  = 6

index, record is 28070      935126847     e()'s match #2
9  * 3  - 5  = 22
1  + 2  + 6  = 9
8  / 4  + 7  = 9
9  / 1  + 8  = 17
3  + 2  + 4  = 9
5  + 6  - 7  = 4

index, record is 32390      926135847     e()'s match #3
9  * 2  - 6  = 12
1  + 3  + 5  = 9
8  / 4  + 7  = 9
9  / 1  + 8  = 17
2  + 3  + 4  = 9
6  + 5  - 7  = 4

index, record is 151910     629135847     e()'s match #4
6  * 2  - 9  = 3
1  + 3  + 5  = 9
8  / 4  + 7  = 9
6  / 1  + 8  = 14
2  + 3  + 4  = 9
9  + 5  - 7  = 7

index, record is 187190     539126847     e()'s match #5
5  * 3  - 9  = 6
1  + 2  + 6  = 9
8  / 4  + 7  = 9
5  / 1  + 8  = 13
3  + 2  + 4  = 9
9  + 6  - 7  = 8

Found with this modified code:
Code: (Select All)
_Title "Alternate Danlin problem" 'b+ 2026-02-26
' 2026-02-27 mod for RA file

Dim record As String * 9
Dim c(1 To 9) As Integer
Dim eq(1 To 6) As Integer
Open "9 permutations.RA" For Random As #1 Len = 9
Open "Match e2 with e3 and e5 for unique 9 digitsets.dat" For Output As #2
index = 0

tryAgain:
index = index + 1
If index > 362880 Then Print: Print "Through Whole File All done!": End
Get #1, index, record
'Print index, record
For i = 1 To 9
    c(i) = Val(Mid$(record, i, 1))
Next
If c(7) / c(8) = Int(c(7) / c(8)) Then
    If c(1) / c(4) = Int(c(1) \ c(4)) Then
        'Print "index, record is"; index, record
        e(1) = c(1) * c(2) - c(3) '4
        e(2) = c(4) + c(5) + c(6) '8  match  e(2)
        e(3) = c(7) / c(8) + c(9) '8  match  with e(3)
        e(4) = c(1) / c(4) + c(7) '9
        e(5) = c(2) + c(5) + c(8) '8  match and with e(5)
        e(6) = c(3) + c(6) - c(9) '6
        If e(2) = 9 _AndAlso e(3) = 9 _AndAlso e(5) = 9 Then
            'If e(2) = e(5) Then ' the middle one across = middle one down
            '        If 2 * e(1) = e(2) Then
            '            If e(4) = 1.1 / 8 * e(2) Then
            '                If e(6) = 3 / 4 * e(2) Then
            count = count + 1
            Print #2, "index, record is"; index, record, "e()'s match #"; _Trim$(Str$(count))
            Print #2, c(1); " *"; c(2); " -"; c(3); " ="; c(1) * c(2) - c(3)
            Print #2, c(4); " +"; c(5); " +"; c(6); " ="; c(4) + c(5) + c(6)
            Print #2, c(7); " /"; c(8); " +"; c(9); " ="; c(7) / c(8) + c(9)
            Print #2, c(1); " /"; c(4); " +"; c(7); " ="; c(1) / c(4) + c(7)
            Print #2, c(2); " +"; c(5); " +"; c(8); " ="; c(2) + c(5) + c(8)
            Print #2, c(3); " +"; c(6); " -"; c(9); " ="; c(3) + c(6) - c(9)
            Print #2, ""

            'Sleep
            GoTo tryAgain:

            'Else
            '    GoTo tryAgain:
            'End If
            'Else
            '    GoTo tryAgain:
            'End If
            '                Else
            '                    GoTo tryAgain:
            '                End If
            '            Else
            '                GoTo tryAgain:
            '            End If
        Else
            GoTo tryAgain:
        End If
    Else
        GoTo tryAgain:
    End If
Else
    GoTo tryAgain:
End If
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
USSR puzzle digital - by DANILIN - 02-26-2026, 11:00 PM
RE: USSR puzzle digital - by DANILIN - 02-27-2026, 07:45 AM
RE: USSR puzzle digital - by bplus - 02-27-2026, 11:09 AM
RE: USSR puzzle digital - by bplus - 02-27-2026, 02:46 PM
RE: USSR puzzle digital - by DANILIN - 02-27-2026, 03:55 PM
RE: USSR puzzle digital - by SMcNeill - 02-27-2026, 04:18 PM
RE: USSR puzzle digital - by SMcNeill - 02-27-2026, 04:58 PM
RE: USSR puzzle digital - by DANILIN - 02-27-2026, 08:11 PM
RE: USSR puzzle digital - by bplus - 02-28-2026, 04:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  School themes from USSR and EurAsia DANILIN 26 7,381 04-01-2025, 07:21 PM
Last Post: bplus
  RoCoLoco Revisited - Math puzzle. Dav 4 1,162 11-03-2022, 09:48 PM
Last Post: DANILIN
  Digital Cube SierraKen 0 605 06-04-2022, 10:28 PM
Last Post: SierraKen
  Triquad puzzle game Rick3137 6 1,839 05-19-2022, 04:53 PM
Last Post: Dav
Rainbow Spiderbro - an adventure puzzle game! crumpets 0 602 05-07-2022, 08:39 AM
Last Post: crumpets

Forum Jump:


Users browsing this thread: 1 Guest(s)