Maths dopers- a puzzle from childhood

Has anyone seen this type of ‘puzzle’ before?

It’s something that my maths teacher showed us when we were about eight years old, and I still remember it.

You start by drawing a large square on a piece of paper, and write four random positive numbers, one at each corner, like so:



32                    67
-----------------------
|                      |
|                      |
|                      |
|                      |
|                      |
|                      |
|                      |
|                      |
|                      |
|                      |
|                      |
------------------------
12                    84


(For the sake of simplicity, we were restricted to numbers below 100- but feel free to start with numbers as large as you like)

Next, at the midpoint of each of the sides of the square, you write the difference (expressed in absolute terms) between the two numbers at the ends of that side. Like so:



32         35         67
-----------------------
|                      |
|                      |
|                      |
|                      |
|                      |
|20                    |17
|                      |
|                      |
|                      |
|                      |
|                      |
------------------------
12         72         84



Now, you draw a new square, connecting the four new numbers you’ve just written (i.e. a smaller square, rotated 45 degress with relation to the first, inside the bigger square, touching it at the midpoints of its sides.) In the example above, this square would connect the 35, 17, 72 and 20.

Now, at the midpoints of the sides of the smaller square, you write the difference in absolute terms between the numbers at then ends of the smaller squares sides…

… then you draw another square, inside the smaller square, connecting these new numbers…

… and so on and so forth.

If you try it, you’ll notice that you quickly come to a small square in the middle that has zero at all four corners. Mostly, this happens within five or six squares, or so. (You’ll also realise why I told you to start with a LARGE square, unless you have a medieval scribe’s ability to write VERY small)

The question that my maths teacher posed was: what’s the most squares you can draw like this before you get to a square with four zeroes?

All of us happily drew squares for the rest of the afternoon… somebody managed seven squares, somebody claimed eight but maybe their subtraction was wrong… an idyllic scene, I’m sure you’ll agree. There seemed to be a limit, probably less than ten squares it seemed to us.

Anyway, now armed with a spreadsheet and a couple of macros, I’ve revisited this problem. I was surprised to find a set of numbers, all less than 45, which led to a series of 14 squares, the 14th being the square with four zeroes. I can do 15, still starting with four numbers below 100, if I allow one of the differences to be expressed negatively.

However, I still have no idea what the absolute limit is, or if indeed there is one if you allow any size numbers to start with (curiously, large numbers seem to make little difference), or whether anyone’s put some serious study into this, or what this puzzle is called (hence no joy at Google).

Does anyone have any idea?

Hmm!

My first thoughts are that if we’re allowed numbers of any size then we can construct squares that take arbitrarily many steps to converge.

I’ll be back.

I have an idea.

As far as I can tell, your analysis is incorrect in all respects.

Below is a list of starting corner numbers, and the number of squares that can be drawn before reaching 0,0,0,0. I only checked up to 3,000.


n1          n2          n3          n4          squares
1           1           1           2           3
1           1           2           4           5
1           2           3           5           6
1           2           5          10           7
1           3           6          12           8
1           3           7          14           9
1           6          15          32          10
1           7          18          38          11
1           8          21          45          12
1          18          49         106          13
1          21          58         126          14
1          25          69         150          15
1          58         163         356          16
1          69         194         424          17
1          82         231         505          18
1         194         549        1202          19
1         231         654        1432          20
1         275         779        1706          21

That’s wrong. You can only get 12 squares, and only if you include 45.

That’s clearly wrong, too.

Continuing along this line of thought: Ultimately, if the numbers can be of any size, then in the extreme case, we’d find an infinite number of steps… - Jinx

I don’t claim to be a genius, but I can’t see a reason that it should be limited, if you choose the right numbers, surely you can carry on as long as you want?

I wouldn’t glorify my thoughts on the matter to call them an analysis!

My bad. Partly a difference in our methods of counting, (I count both the initial and final ‘zero’ square) and partly an inexcusable deviation on my part from the original parameters- I allowed myself to start with zero- not a well-known positive number, I’ll admit.

FWIW, I was thinking of 0, 24, 37, 44.

Thanks for the analysis- clearly some kind of pattern is present in your figures- n3/n2 is tending towards something like 2.83, while n4/n3 is close to 2.18- I wonder why?

In mitigation, your honour, my point about large numbers making little difference is valid in some respects. The natural response, in searching for a long series of squares, is to try huge numbers. But in the vast majority of cases, this makes no difference. If you randomly choose four numbers less than a billion, say, it’s surprising how quickly they collapse to zero.

For example, 34983498, 84820504, 2103874 and 60987233- huge numbers, but reduced to zero in five squares.

The worst case scenario is when all corners have 2[sup]n[/sup] at all four corners. In that case, you need n squares to get to zero.

Oops. That’s not right. Back to the drawing board.

I haven’t done the math, but if the resulting corner number of the new square is the difference, as described in the OP, wouldn’t the number of squares increase as the difference increases?

For example, what if the corners of the original square were: (1)(1)(1) and (987,654,321)? Wouldn’t this result in about 987 billion squares?

What am I doing wrong?

I don’t know what you mean ultrafilter, if each corner has 2[sup]n[/sup] then it converges next iteration (I know you meant something else.

Powers of two do seem to be pretty “efficient”:



 1             2             4             8   takes  8 iterations
 1             4             8            16   takes 10


But after 2[sup]5 [/sup] nothing much happens(?)

(On preview I see you take it back)

and hammos1 those ratios look interesting, though convergent? I’m not sure, more values:



 1             1             2             4             7 
 1             2             5             10            9 
 1             4             11            23            11 
 1             9             24            51            13 
 1             11            30            65            14 
 1             18            49            106           15 
 1             21            58            126           16 
 1             25            69            150           17 
 1             58            163           356           18 
 1             69            194           424           19 
 1             82            231           505           20 
 1             194           549           1202          21 
 1             231           654           1432          22 
 1             275           779           1706          23 
 1             654           1855          4064          24 
 1             779           2210          4842          25 
 1             928           2633          5769          26 


Actually, now that I think about it some more, Fibonacci numbers might be the way to go. Starting with f[sub]n[/sub], f[sub]n+1[/sub], f[sub]n+2[/sub] and f[sub]n+3[/sub] would probably get you going for a while.

Some of the differences would end up the same - which would later cancel themselves out.



        1          1          1  987654321
987654320          0          0  987654320
        0  987654320          0  987654320
987654320  987654320  987654320  987654320
        0          0          0          0


Your example (and any of the form 1,1,1,x) needs 5 steps to converge.

I’ve tried playing with the math - I can’t prove that it always converges, but it intuitively seems that it should.

You haven’t done the math. Oh, you said that.

Off the top of my head, if we have X,1,1,1
then next generation is X-1,X-1,0,0

then 0,X-1,0,X-1

then X-1,X-1,X-1,X-1

then 0,0,0,0

ultrafilter Fibonacci numbers? first thing I tried, seemed to promise nothing…

Thanks NE Texan, I should have tried it on paper. I appreciate you taking the time to provide the incremental steps.

Upon posting and seeing his response, I’ll thank The Great Unwashed too. ~embarrassed grin~

Oops, I was replying to Algernon. Popular thread.

Let’s see, Fibonacci numbers, as ultrafilter suggests:

f(n), f(n+1), f(n+2), f(n+3) would next be
f(n-1), f(n), f(n+1), 2f(n+1), then
f(n-2), f(n-1), f(n+1), [f(n+1)+f(n)], and then…

You may be right, with some high Fibonacci’s, I wonder how it would go?

It was just a guess.

At bottom, you’ve got 0, 1, 1, 2. That goes (0, 1, 1, 2), (1, 0, 1, 2), (1, 1, 1, 1), (0, 0, 0, 0). So four iterations for the base. That’s not a bad start.

Try 1, 1, 2, 3. (1, 1, 2, 3), (0, 1, 1, 2), and so forth. Five iterations. Hmm…might be a pattern here.

How about 1, 2, 3, 5? (1, 2, 3, 5), (1, 1, 2, 4), (0, 1, 2, 3), (1, 1, 1, 3), (0, 0, 2, 1), (0, 2, 1, 1), (2, 1, 0, 1), (1, 1, 1, 1), (0, 0, 0, 0). Not the pattern I was looking for, but that’s nine iterations. Nine is the sum of five and four. Curious, ain’t it?

I’m gonna do 2, 3, 5, 8. (2, 3, 5, 8), (1, 2, 3, 6), (1, 1, 3, 5), (0, 2, 2, 4), (2, 0, 2, 4), (2, 2, 2, 2), (0, 0, 0, 0). Huh. Not quite the pattern I expected. Still, seven iterations.

So far we have 4, 5, 9, 7. Nothing shows up at Sloane’s for that.

Just out of curiosity, let’s go for 3, 5, 8, 13. (3, 5, 8, 13), (2, 3, 5, 10), (1, 2, 5, 8), (1, 3, 3, 7), (2, 0, 4, 6), (2, 4, 2, 2), (2, 2, 0, 0), (0, 2, 0, 2), (2, 2, 2, 2), (0, 0, 0, 0). Well, that’s 10.

I’ll set up a spreadsheet to play around with this.