• + 0 comments

    This problem is obscenely difficult, and I spent days researching just to get fairly close to the correct solution, then I spent days more tweaking my approach to conform to the extra constraints created by the problem itself. In order to complete this in a reasonable time, you have to dig into number theory by realizing that, at least for a=1 to b=(some number of consecutive 9's), the problem resembles a permutation problem (since we take the sums/squares of these numbers, the question becomes 'how many combinations of k digits result in a prime number between 1 and 999999999999999999 when (summed) or (squared)?' and 'how can you exclude permutations that are less than a, and greater than b?'

    Honestly, I'm still not even finished trying to make the damn thing work, I just know the approach WILL work, once I've debugged everything.