What's wrong with this code for INOI 2015 P2

Can somebody please point the error in this code ? Thanks !

I have used the recursion q(n) = 2^n - \sum_{ m | n, m < n} q(m), where q is the number of aperiodic strings of length n.

https://pastebin.com/raw/EXRMmLg0

Thanks !

i am not having time for debugging now, as i am also appearing for inoi. u can compare ur solution from my solution if needed. IOIPractice/2015-02 Periodic Strings.cpp at master · JVJplus/IOIPractice · GitHub