You are viewing a single comment's thread. Return to all comments →
First generate all pentagonal, triangle and hexagonal numbers below 2*10^14 . Then for each test case, use binary search to find the answer.
Project Euler #45: Triangular, pentagonal, and hexagonal
You are viewing a single comment's thread. Return to all comments →
First generate all pentagonal, triangle and hexagonal numbers below 2*10^14 . Then for each test case, use binary search to find the answer.