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