Project Euler 278 - Linear Combinations of Semiprimes
Project Euler 278 - Linear Combinations of Semiprimes
Official link: https://projecteuler.net/problem=278
Thought Process
Thought Process
This was a really fun problem for me.
First my research led me to the Frobenius Number, which is exactly what we are looking for!
Implementing a full scale algorithm turned out to be quite hard, I finally managed to do it long after the problem and it will be added to my math library
But in order to solve the problem we can make use of a very neat trick, which you may find here: https://www.sciencedirect.com/science/article/pii/S0022314X16301743?via%3Dihub#en0020
Brute force looping does the trick from here!
Interactive Code
Interactive Code
Input an integer (yourinput)
Code outputs sum f(pq, pr, qr) for p < q < r < yourinput where p, q, r are primes