Basic way to calculate all prime factors
while ( temp > 1 ) { long x = lpf [ ( int ) temp ] ; single_number . put ( x , ( single_number . get ( x ) == null ? 1 : single_number . get ( x ) + 1 ) ) ; temp /= x ; }