Sketch of solution. We use the fact that the limit of the product (running on all primes) is 0 for 1 and is positive for >1.
Consider the first n primes p1,...,pn and sieve out the indices which are thie multilpies. We obtain
If n then the left-hand side converges to a1 because all other terms are sieved out.
If 1 then the right-hand side converges to 0, therefore a1=0. Taking a positive integer l and repeating the same procedure for the subsequence akl we obtain al=0.
If >1 then the right hand side has a positive limit . In this case .
Summarizing the results: for 1 the only solution is the constant 0. For >1, the solution is .