Playing With Your Mind

Limits: 1s, 512 MB

Given a non-negative integers N. You have to find an integer P such that, the following conditions should be fulfilled.


This is a companion discussion topic for the original entry at https://toph.co/p/playing-with-your-mind