4
$\begingroup$

If you follow our rules, and you start with 1 and 5 then it goes into

1, 5, 1, 3, 1, 1, 1,...

If you follow our rules, and you start with 14 and 2 then it goes into

14, 2, 10, 2, 6, 2, 2, 2,...

If you follow our rules, and you start with 2 and 14 then it goes into

2, 14, 2, 10, 2, 6, 2, 2, 2,...

If you follow our rules, and you start with 9 and 3 then it goes into

9, 3, 3, 3, 3,...

If you follow our rules, and you start with 26 and 61 then it goes into

26, 61, 26, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0,...

$\endgroup$
  • $\begingroup$ What's the source of this puzzle? $\endgroup$ – Nathan Hinchey Jun 12 '18 at 18:28
  • 1
    $\begingroup$ @NathanHinchey No source, just created it myself. $\endgroup$ – Vincent Mia Edie Verheyen Jun 13 '18 at 6:05
2
$\begingroup$

A minor refinement on athin's answer to account for the last sequence:

Denote the last two numbers in the sequence are $A$ and $B$ (initially there are only two numbers).

If $A < B$, append $A$ to the sequence;
else, append the greater of $A-2B$ and 0.

$\endgroup$
  • 1
    $\begingroup$ But, for $1 1$, it should be $1$ not $0$ on the first sequence. $\endgroup$ – athin Jun 12 '18 at 0:25
  • $\begingroup$ Good point! My answer does not account for all of them! $\endgroup$ – Nathan Hinchey Jun 12 '18 at 18:27
9
$\begingroup$

It's possible that the rule is:

Denote the last two numbers in the sequence are $A$ and $B$ (initially there are only two numbers).

If $A < B$, append $A$ to the sequence;
else, append $|A-2B|$.

$\endgroup$
  • 5
    $\begingroup$ In this case, the last sequence is wrong! $\endgroup$ – Florian Bourse Jun 11 '18 at 13:25
  • $\begingroup$ you need a second "if": if $A>2B$, append $|A-2B|$, else append $A - 2$ (or $B - 1$?). $\endgroup$ – GentlePurpleRain Jun 11 '18 at 14:53
  • $\begingroup$ Oh, and if $A=B$, append $A$ (or $B$). $\endgroup$ – GentlePurpleRain Jun 11 '18 at 14:54
  • $\begingroup$ Whoops I just realized this.. and uh tbh it's rather hacky to have 3 ifs btw :( $\endgroup$ – athin Jun 12 '18 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.