Collision free one way function
No, it is not collision-free. All possible sequences of 0's produce the same output:

0    --&gt; (2 ** 0) = 1
00   --&gt; (2 ** 0) * (3 ** 0) = 1
000  --&gt; (2 ** 0) * (3 ** 0) * (5 ** 0) = 1
0000 --&gt; (2 ** 0) * (3 ** 0) * (5 ** 0) * (7 ** 0) = 1


In fact, it can be seen that $f(s) = f(s||0)$, for every bit-string $s$.

This could be easily solved by initializing the exponents to 1, and not to 0. 

Anyway, I'm afraid you have not discovered anything new. The Fundamental theorem of arithmetic states that any positive integer can be represented uniquely by a product of prime numbers:

$$n
= p_1^{\alpha_1}p_2^{\alpha_2} \cdots p_k^{\alpha_k}
= \prod_{i=1}^{k}p_i^{\alpha_i}$$

Your idea is basically a method for interpreting the bit string as the sequence of exponents $\alpha_1, \alpha_2, ..., \alpha_{k}$.

It is also very easy to invert (leaving aside the issue of the number of trailing 0's). Let us assume that $f(s) = n$. If $n$ is divisible by 2, then the first bit of $s$ is 1. Now you divide by 2 and if the result is divisible by 2, then the next bit of $s$ is also 1. Repeat until it is not divisible by 2, and you know the next bit is 0. Repeat this process with the divisibility of 3, 5, 7, etc.



With respect to the new question you added: yes, there are collisions. 

For example: $f(1) = f(2) = f(4) = ... = f(2^k) = 2$

In fact, for any integer $n$, it can be seen that $f(n) = f(n\cdot 2^k)$, for every integer $k&gt;0$, which means that for each integer there are infinite collisions.