Here you can find the source of getFibonacciSeq(long f)
public static int getFibonacciSeq(long f)
//package com.java2s; //License from project: Open Source License import static java.lang.Math.*; public class Main { public static final double GOLDEN_RATIO = (1 + sqrt(5)) / 2; public static int getFibonacciSeq(long f) { return (int) Math.floor(Math.log(f * sqrt(5) + 0.5) / Math.log(GOLDEN_RATIO)); }// w w w . ja v a2 s .com }