Deret fibonachi dan nilai pi yang dianggap sebagai proporsi agung dengan implementasi java.

/**
 *
 * @author ashril
 */
public class Fibonachi 
{
    //Fungsi Fibonachi
    static int fibonachi (int n) 
    {
        if (n==0 || n==1) 
        {
            return 1;
        }
        else 
        {
            return fibonachi(n-1)+fibonachi(n-2);
        }
    } 

    public static void main(String[] args) 
    {
        int n=10;
        for (int i=0;i<=n;n;i++)
        {
            System.out.print(fibonachi(i));
        }
        
        //Proporsi Agung
        System.out.println(\n);
        for (int i=1;i<=n;i++)
        {
            double x = fibonachi(i);
            double y = fibonachi(i-1); 
            double proporsi = x/y;
            System.out.print(proporsi);
        }
    }
}
Advertisement