Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Can you use a prime more than once? I guess not, given the equation provided, and if you can it is trivially easy just using 1. And in that case the answer is no because it does not work for n = 2, 3, 6, 7, 8. I guess I am missing something here - I am not a mathematician - and I would be curious to know what.