 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Dascal triangle (Posted on 2016-02-02) Arrange integers 1- 15 in a triangle such that the upper row consists of 5 integers, all other rows represent each the absolute values of the differences between the adjacent members of the row above so that the 5th row contains one number only.

```4   7  15  10   2
3  12   5   8
9   7   * oops!  Can't use 3 again.```
Just wanted to explain the build-up..
Better luck to the solvers!

 No Solution Yet Submitted by Ady TZIDON No Rating Comments: ( Back to comment list | You must be logged in to post comments.) computer solution | Comment 1 of 8
The two mirror-image solutions are:

6 14 15 3 13
8 1 12 10
7 11 2
4 9
5

13 3 15 14 6
10 12 1 8
2 11 7
9 4
5

DefDbl A-Z
Dim crlf\$, grid(5, 5), used(15)

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

Text1.Text = Text1.Text & crlf & " done"

End Sub

If row = 1 Then
For i = 1 To 15
If used(i) = 0 Then
grid(row, col) = i
used(i) = 1

r = row: c = col + 1
If c > 5 Then r = r + 1: c = 1

used(i) = 0
End If
Next
Else
diff = Abs(grid(row - 1, col) - grid(row - 1, col + 1))
If used(diff) = 0 Then
grid(row, col) = diff
used(diff) = 1

r = row: c = col + 1
If c > 6 - row Then r = r + 1: c = 1
If r < 6 Then
Else
For r = 1 To 5
For c = 1 To 6 - r
Text1.Text = Text1.Text & Str(grid(r, c))
Next c
Text1.Text = Text1.Text & crlf
Next r
Text1.Text = Text1.Text & crlf
End If

used(diff) = 0
End If
End If
End Sub

 Posted by Charlie on 2016-02-02 15:37:44 Please log in:

 Search: Search body:
Forums (3)