Project Euler 203 - Squarefree Binomial Coefficient
Project Euler 203 - Squarefree Binomial Coefficient
Official link: https://projecteuler.net/problem=203
Thought Process
Thought Process
One of the easiest problems i've tried so far, the numbers are so small that you could just brute force the entire thing.
One key point to bring the speed down is to notice that the largest possible prime that divides C(n, k) must be less than n this means we only need to check if the square of the the prime up to 47 divide the binomial terms.
I the first half of each row (because they are symmetric) and go through the primes.
Interactive Code
Interactive Code
Enter a number (yourinput)
Code will output the sum of the distinct squarefree numbers in the first yourinput rows of Pascal's triangle