Project Euler: Concatenation and Coincidences
Has been a while (one year) since I've tackled a Project Euler (PE) problem. This is my 205th Euler problem solved (after problem 100th, it gets really intense). It is rare that the gods of PE release any easy problem these days, but since this one had a difficult rating of 5% (which is the easiest for a PE), I decided to take a look today.
One note thou: I can't post neither the solution (which is a number) nor the code to produce the solution since the PE gods will track you down and suspend your account, so I'll just talk in high-level terms about the problem without disclosing much of the solution. Here is the problem: Problem 751 - Project Euler
I can at least talk about the implementation of the function to generate An. It is actually fairly straightforward:
1/ I didn't do it recursively
2/ It is a combination of using the Floor function and simple concatenation rules
You can see the code down below for the concatenation function. Once I had that function I started playing with some inputs and there is actually an easy pattern that you can spot once the concatenation function is up. That's pretty much all that I can say. Give it a try. The (partial) code is down below. Cheers, ACC.
Comments
Post a Comment