Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded a solution for Project Euler Problem 203 "Squarefree Binomial Coefficients" #3513
Conversation
…ngle. Changes based on review suggestion.
| {1, 2, 3, 5, 6, 7, 35, 10, 15, 21} | ||
| """ | ||
|
|
||
| def get_squared_primes_to_use( |
dhruvmanila
Oct 25, 2020
Member
A function within a function is mostly used as a wrapper. This doesn't seem like that so please separate them out.
A function within a function is mostly used as a wrapper. This doesn't seem like that so please separate them out.
|
can you please help me in participating in the 2020 hacktoberfest, submitting the preferred PR and contributing as required by hacktoberfest thereby being eligible for the T-shirt and swags or planting a tree |


Describe your change:
Added a solution to Project Euler Problem 203 "Squarefree Binomial Coefficients" Link.
The solution is based on three main pilars.
d.2and the maximum coefficientCmaxusing a variant of the Sieve of Eratosthenes Link and considering that the square of each prime must be less or equal than thatCmax. The calculation returns the square of those primes.ninton = p * p * rwherepis a prime number calculated before andris a positive integer. If norcan be found for all squared primes, then the number is squarefree, else, the number is non-squarefree.After all unique squarefree numbers are calculated, they're summed-up to provide the final answer.
Checklist:
Fixes: #{$ISSUE_NO}.