## Welcome to BrainDen.com - Brain Teasers Forum

Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account. As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends. Of course, you can also enjoy our collection of amazing optical illusions and cool math games. If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top. If you have a website, we would appreciate a little link to BrainDen. Thanks and enjoy the Den :-) |

# Diamond Subtraction

### #1

Posted 10 May 2013 - 07:11 PM

Put four different whole numbers from 1 to 49, in the corners, then subtract the smaller from the larger and put the answers in between. Keep doing this until all four numbers become equal. How many steps can you make it last? The demo is "(14, 30, 18, 37) lasts 3 steps (don't count the step where they produce the same number)." Find the longest lasting case.

DEMO:

stage 0

14 30 ----> 30-14

37-14 30-18

37 18 37-18

stage 1

16 16-13 16-12

13 12

19 19-13 19-12

stage 2

3 4

6 7

stage 3

1

3 3

1

Stage 4 is stasis so it doesn't count

### #2

Posted 10 May 2013 - 08:26 PM

*The greatest challenge to any thinker is stating the problem in a way that will allow a solution.*

- Bertrand Russell

### #3

Posted 10 May 2013 - 08:38 PM Best Answer

### #4

Posted 10 May 2013 - 09:09 PM

Spoiler for

*The greatest challenge to any thinker is stating the problem in a way that will allow a solution.*

- Bertrand Russell

### #5

Posted 10 May 2013 - 09:38 PM

Spoiler for

Can you share the code?

### #6

Posted 10 May 2013 - 10:18 PM

Can you share the code?

I'm sure there are more elegant ways of coding this, and it only gives back the first longest set it finds (it won't return 8,21,45,1 after it finds 1,8,21,45) so I'm sure there is more than one answer.

### #7

Posted 10 May 2013 - 10:49 PM

Just realized the section:

a1=sqrt ((a2-b2)*(a2-b2));

b1=sqrt ((c2-b2)*(c2-b2));

c1=sqrt ((c2-d2)*(c2-d2));

d1=sqrt ((a2-d2)*(a2-d2));

should actually be:

a1=sqrt ((a2-d2)*(a2-d2));

b1=sqrt ((a2-b2)*(a2-b2));

c1=sqrt ((c2-b2)*(c2-b2));

d1=sqrt ((c2-d2)*(c2-d2));

I don't think it really it effects the outcome, since it stayed in the same order. But still.

### #8

Posted 11 May 2013 - 12:46 AM

Spoiler for Just to be sure

yes, your example is 2 steps.

### #9

Posted 11 May 2013 - 12:47 AM

Spoiler for Just to be sure

my example though shows 3 steps

### #10

Posted 11 May 2013 - 12:56 AM

Spoiler for

Anything special about these numbers?

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users