-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove while-break from A006577 * Refactor A000045 to remove `yield 0` * Refactor A000217 (Triangle numbers) to avoid factorials The previous code appears to use binomial(n+1, 2) rather than the faster n(n+1)/2 form. Reduced from O(n) multiplications to O(1) * Refactor A000203 to keep running sum Reduces space use (single int is much smaller than a list) * Refactor A133058 to remove extra if branch * Change range in A000005 to remove zero-check * Square duplicated factorial from A000108 2*i-i == i, so just square i! * Refactor A001622 to be correct for all n The prior version would be inaccurate for values of n over 99999 (but it took a long time to evaluate that far) Test validates 2000 decimal places (from goldennumber.net), to check that precision scales at the right time --------- Co-authored-by: Julien Palard <[email protected]>
- Loading branch information
1 parent
a9364c9
commit de0c7b5
Showing
2 changed files
with
70 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters