Golf a Custom Fibonacci Sequence

Jelly, 3 bytes

+¡ạ

Takes x, y, and n (0-indexed) as separate command-line arguments, in that order.

Try it online!

How it works

+¡ạ  Main link. Left argument: x. Right argument: y. Third argument: n

  ạ  Yield abs(x - y) = y - x, the (-1)-th value of the Lucas sequence.
+¡   Add the quicklink's left and right argument (initially x and y-x), replacing
     the right argument with the left one and the left argument with the result.
     Do this n times and return the final value of the left argument.

CJam, 14 9 bytes

l~{_@+}*;

Try it online!

Input format is "x y n". I'm still a noob at this, so I'm 100% sure there are better ways to do this, but please instead of telling me "do this" try to only give me hints so that I can find the answer myself and get better. Thanks!


JavaScript (ES6), 27 26 bytes

Nothing fancy here, just a standard JS Fibonacci function with the initial values of 0 & 1 removed.

n=>g=(x,y)=>n--?g(y,x+y):x

Try it

f=
n=>g=(x,y)=>n--?g(y,x+y):x
o.value=f(i.value=13)(j.value=2308,k.value=4261)
oninput=_=>o.value=f(+i.value)(+j.value,+k.value)
*{font-family:sans-serif;}
input{margin:0 5px 0 0;width:50px;}
#o{width:75px;}
<label for=i>n: </label><input id=i type=number><label for=j>x: </label><input id=j type=number><label for=k>y: </label><input id=k type=number><label for=o>= </label><input id=o>