If number is 1 , then it will have only 1 as a factor . So , total factors will be 1.
if ( $ n == 1 ) return 1 ; $ prime = array_fill ( 0 , ( $ n + 1 ) , false ) ; $ primesquare = array_fill ( 0 , ( $ n * $ n + 1 ) , false ) ;