Interesting facts about Fibonacci numbers | JavaScript 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
var MAX = 100 ; var arr = new Array ( MAX ) ; arr [ 0 ] = 0 ; arr [ 1 ] = 1 ; for ( var i = 2 ; i < MAX ; i ++ ) arr [ i ] = arr [ i - 1 ] + arr [ i - 2 ] ; document . write ( " " ) ; for ( var i = 1 ; i < MAX ; i ++ ) if ( arr [ i ] % i == 0 ) document . write ( i + " " ) ;