Project Euler 632 - Square Prime Factors
Official link: https://projecteuler.net/problem=632
Note: I am currently not happy with my understanding of this problem
Calculating the given values through brute force was fairly simple, just a Mobius Sieve but while doing it keep a count of if a number has a square prime factor.
I then believed that because the standard equation for calculating the number of square-free numbers (In this case C0(N)) is using the Inclusion-Exclusion principle, I believe it could be extended.
I found the Generalised Inclusion-Exclusion Principle and a few other helpful pages, mainly this one: https://math.stackexchange.com/questions/100299/demonstrate-another-way-to-implement-the-inclusion-exclusion-principle/362516#362516
Using this and some trial and error with my code (mainly messing with the exponent of -1) I was able to able to solve the question and come up with a closed formula which I am not able to prove yet.
Enter an integer (yourinput)
Code will output Product of all non-zero Ck(yourinput) (mod 1,000,000,007)