[Jelly]Jelly, 8 7 6 [bytes]bytes
-r‘ÆḞċ [Try it online!][TIO-j3x8ymyn]Try it online!
How?
-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 r - inclusive range = [-1,0,1,2,3,4,5,...,n] ‘ - increment n = [ 0,1,2,3,4,5,6,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,5,8,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) Notes:
- the increment,
‘, is needed so this works for 2 and 3, since they are the 3rd and 4th Fibonacci numbers - beyond 3 all Fibonacci numbers are greater than their index. - the
-is needed (rather than just‘R) so this works for 0 since 0 is the 0th Fibonacci number; [Jelly]: https://github.com/DennisMitchell/jelly [bytes]: https://github.com/DennisMitchell/jelly/wiki/Code-page [TIO-j3x8ymyn]: https://tio.run/##y0rNyan8/1@36FHDjMNtD3fMO9L9//9/Q2MA "Jelly – Try It Online"