Problem 193
Found searching for “project euler” in OEIS.
The reason it's a cliche is because it's true.
These all flow from 114, and the secret there is to use recursion to try to fill the space to the right. Don’t forget to memoize the recursion function.
Easily done if you have a few million primes on hand.
There’s a sequence in Sloane that gives the answer directly, too!
Finding the number of blue discs for which there is 50% chance of taking two blue.
I started researching the hypergeometric distribution and thought about comparing it to a binomial distribution at large numbers before twigging that if you expand the problem it’s a quadratic Diophantine equation. There’s an online solver that provides factors for these equations and after that it was simply a matter of plugging them in.
Squarefree binomial coefficients.
I had in mind optimisations in only calculating half the triangle, but in the end it didn’t signify. I used the Pari issquarefree() function. Biggest issue was forgetting telling Perl to use arbitrary precision integers.
Investigating the numbers which are equal to sum of their digits raised to some power.
I turned this over in my mind trying to find some limit so I didn’t have such an enormous search space. Then I found A023106 in Sloane which gives all but the last few terms, and then it was really fast to brute force.
To be quite honest this was a bit easy for this level.