posted 15 years ago
Well isPrime is easy. check the number divisibility with i = 0 to i < squareroot of the number. Well that is understood. Well what i have wrritten is a kind of pseudocode only. l1 is a set whereas l has the primes. The method i thought is
eg:- 4095 = 3^2 * 5^1 *7^1 * 13^1. So 3^0 5^0 7^0 13^0, then 3^0 5^1 7^1 13^1 the 3^1 5^0 7^0 13^0 and so on for every number 5(0,1),7(0,1) and 13(0,1).
On paper every possible combination is calculated. But to convert it to an implementation is kind of giving me a problem.
[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api