We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I guess we're not allowing negative values of n for P_n = n * (3n - 1)? Otherwise, the answer to the test case would also include 117, since P_-11 = 187 = 117 + 70 = P_9 + P_7.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #44: Pentagon numbers
You are viewing a single comment's thread. Return to all comments →
I guess we're not allowing negative values of n for P_n = n * (3n - 1)? Otherwise, the answer to the test case would also include 117, since P_-11 = 187 = 117 + 70 = P_9 + P_7.