OFFSET
0,3
MATHEMATICA
Module[{nn=11, fibs}, fibs=Fibonacci[Range[nn]]; Join[{0}, Drop[Flatten[Table[If[MemberQ[ fibs, n], Position[fibs, n], -1], {n, Range[Last[fibs]]}]], {2}]]] (* Harvey P. Dale, May 13 2023 *)
PROG
(Python)
from sympy import log, ceiling, sqrt, S
from sympy.ntheory.primetest import is_square
def A361508(n): return n if n<=1 else (ceiling(log(n*sqrt(5)-S.Half, (1+sqrt(5))/2)) if is_square(m:=5*n**2-4) or is_square(m+8) else -1) # Chai Wah Wu, Mar 30 2023
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Mar 30 2023
STATUS
approved