>>910 Lua
function isFib(n)
  local a, b, c = 0, 1, 1
  while a < n do
    a, b, c = b, a + b, c + 1
  end
  if a ~= n then c = -1 end
  return n, c
end