A Sumac sequence starts with two integers: t1 and t2.
The next term, t3, = t1 - t2
More generally, tn = tn-2 - tn-1
The sequence ends when tn < 0.
Your challenge: Write a program or function that prints the length of a Sumac sequence, starting with t1 and t2.
- t1 and t2 are integers within your language's range.
- Standard loopholes apply.
t1 t2 sumac_len(t1,t2) 120 71 5 101 42 3 500 499 4 387 1 3
Bonus street cred:
3 -128 1 -314 73 2
This is code-golf, so shortest answer in bytes wins.