The RSA security cryptosystem is very popular and is used by many internet protocols including SSH, SSL and TLS. The security of the RSA cryptosystem is highly dependent on the factorization speed of the modulus n into its composite primary numbers p and q. In this paper, an algorithm is presented to improve the factorization speed. The algorithm is based on reducing the size of the solution space for both p and q by analyzing the most two significant digits of n and dividing the solution space into multiple spaces. The repeating frequency of the most significant digit for p and q is then calculated. A statistically optimized search is then conducted to find the values of p and q. To test the algorithm, several simulation scenarios are explored. The proposed algorithm is compared with brute force attack. Results show that there is significant reduction in the primary numbers tested before solution is found. Based on the results, it is recommended that this algorithm be used when the brute force is the optimum choice, due to its simplicity.