4, 7, 3, 4,….

In the sequence above, the first term is 4, the second term is 7, and each term after the second term is the nonnegative difference between the previous two terms. If the nth term is the first term of the sequence that is equal to zero, what is the value of n?

Okay I know this number can be solved through first principles(finding each number in the sequence manually) but I can’t help but wonder if there’s a certain algebraic formula or method one can utilize to solve it.