---
title: "The four number game"
author: "cjc"
date: "2008-11-24T20:27:00Z"
tags: []
slug: "the-four-number-game"
draft: false
lastmod: "2008-11-24T20:27:00Z"
id: 299047
url: "https://cjc.iteye.com/blog/299047"
---

The Four Numbers Game is a [mathematical game](http://everything2.com/title/mathematical%2520games "mathematical games"), as taught by Dr. [Paul Sally](http://everything2.com/title/Paul%2520Sally "Paul Sally"), Prof. of [Mathematics](http://everything2.com/title/Mathematics "Mathematics") at the [University of Chicago](http://everything2.com/title/University%2520of%2520Chicago "University of Chicago"). To play this [game](http://everything2.com/title/game "game"), draw a [square](http://everything2.com/title/square "square") and put a [number](http://everything2.com/title/number "number") at each [corner](http://everything2.com/title/corner "corner"), thus:

```
5___9
|   |
|   |
|   |
7___13
```

Now form a new [square](http://everything2.com/title/square "square") based on the [difference](http://everything2.com/title/difference "difference") between each the values at the ends of each [side](http://everything2.com/title/side "side"). Example:

```
5_4_9
|   |
2   4
|   |
7_6_13
```

This gives a new square, which I'll [rotate](http://everything2.com/title/rotate "rotate") [anticlockwise](http://everything2.com/title/anticlockwise "anticlockwise") 45 degrees.

```
4___4
|   |
|   |
|   |
2___6
```

This in turn gives

```
0___2
|   |
|   |
|   |
2___4
```

Then

```
2___2
|   |
|   |
|   |
2___2
```

Then

```
0___0
|   |
|   |
|   |
0___0
```

At this point, the game is over.

 

 

Codes for geting any four given numbers:

 

 

01. Sub FourNumbers(ByRef steps As String, ByRef count As Long, ParamArray s())
02. Dim temp As String, tempcount As Long
03. count = 1
04. If s(0) & s(1) & s(2) & s(3) = "0000" Then steps = Join(s, ","): Exit Sub
05. FourNumbers temp, tempcount, Abs(s(0) - s(1)), Abs(s(1) - s(2)), Abs(s(2) - s(3)), Abs(s(3) - s(0))
06. steps = Join(s, ",") & vbCrLf & temp
07. count = tempcount + 1
08. End Sub
09. Sub Getit()
10. Dim steps As String, count As Long
11. FourNumbers steps, count, \[exp(1)], \[pi()], 1, 0
12. Debug.Print "Count=" & count & vbCrLf & String(50, "-") & vbCrLf & steps
13. FourNumbers steps, count, 149, 274, 504, 927
14. Debug.Print "Count=" & count & vbCrLf & String(50, "-") & vbCrLf & steps
15. End Sub

It returns:

 

Count=5  
\--------------------------------------------------  
2.71828182845905,3.14159265358979,1,0  
0.423310825130748,2.14159265358979,1,2.71828182845905  
1.71828182845905,1.14159265358979,1.71828182845905,2.2949710033283  
0.576689174869252,0.576689174869252,0.576689174869252,0.576689174869252  
0,0,0,0

 

Count=19  
\--------------------------------------------------  
149,274,504,927  
125,230,423,778  
105,193,355,653  
88,162,298,548  
74,136,250,460  
62,114,210,386  
52,96,176,324  
44,80,148,272  
36,68,124,228  
32,56,104,192  
24,48,88,160  
24,40,72,136  
16,32,64,112  
16,32,48,96  
16,16,48,80  
0,32,32,64  
32,0,32,64  
32,32,32,32  
0,0,0,0