Interesting facts about Fibonacci numbers | Java program to demonstrate that Fibonacci numbers that are divisible by their indexes have indexes as either power of 5 or multiple of 12. ; storing Fibonacci numbers
class GFG { static int MAX = 100 ; public static void main ( String [ ] args ) { long [ ] arr = new long [ MAX ] ; arr [ 0 ] = 0 ; arr [ 1 ] = 1 ; for ( int i = 2 ; i < MAX ; i ++ ) arr [ i ] = arr [ i - 1 ] + arr [ i - 2 ] ; System . out . print ( " Fibonacci ▁ numbers ▁ divisible ▁ by ▁ " + "their indexes are :NEW_LINE"); for ( int i = 1 ; i < MAX ; i ++ ) if ( arr [ i ] % i == 0 ) System . out . print ( i + " ▁ " ) ; } }