2 added 268 characters in body
source | link

R, 6162 bytes

function(n){while(sum(F|1)<n)F=c(match(F[1],F[-1],0),F)
F[1]+F[1]}

Try it online!Try it online!

Builds the list in reverse; match returns the first index of F[1] (the previous value) in F[-1] (the remainder of the list), returning 0 if no match is found.

F is initialized to FALSE and is coerced to 0 on the first pass of the while loop.

R, 61 bytes

function(n){while(sum(F|1)<n)F=c(match(F[1],F[-1],0),F)
F[1]}

Try it online!

R, 62 bytes

function(n){while(sum(F|1)<n)F=c(match(F[1],F[-1],0),F)
+F[1]}

Try it online!

Builds the list in reverse; match returns the first index of F[1] (the previous value) in F[-1] (the remainder of the list), returning 0 if no match is found.

F is initialized to FALSE and is coerced to 0 on the first pass of the while loop.

1
source | link

R, 61 bytes

function(n){while(sum(F|1)<n)F=c(match(F[1],F[-1],0),F)
F[1]}

Try it online!