[Jelly], 8 7 6 [bytes]
-r‘ÆḞċ [Try it online!][TIO-j3x8ymyn]
How?
-r‘ÆḞċ - Link: non negative number, n - - literal -1 ‘ - increment n r - inclusive range = [-1,0,1,2,3,...,n] ÆḞ - Fibonacci = [ 0,1,1,2,3,...,fib(n+1)] ċ - count occurrence of n Notes:
- the increment,
‘, is needed so this works for 3, since 3 is the 4th Fibonacci number - 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 -1th (-1st?) 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"