but why not to extract alla the 3's,5's...that's why i mentioned use a list of prime factors...
You can have an array of primes to be used for i. There is no argument.
The point is, what could be the largest prime factor which is going to be a factor of the arbitrary number.
If you can decide on this, you can use a static array (with fixed number of elements).
let me asky you sth else.. any idea for that: if i want to find alla the numbers between ,lets say 1 and 100.000.000 whose largest prime factor is less than 1024...??
You can do that quite easily by calling the prime factor function on the first post repeatedly for numbers between 0 to N.
Modify the function to return the largest prime for each number so that you can check whether that is less the 1024 or anything and store them in an array. That will give you the list you need in an array at the end of execution.
It seems to me the first thing you should do is to make the function working in whatever language you need...(C, Java, C#, Etc...). When you see the output, you can change/improve it as you need.