Skip to content

Commit

Permalink
Correct several minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 23, 2024
1 parent 11e410e commit 3b3579d
Showing 6 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion c/p0012.c
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ unsigned long long p0012() {
while (true) {
current = next(ti);
// printf("%llu\n", current);
if (proper_divisor_count(current) > 499)
if (proper_divisor_count(current) > 500)
return current;
}
}
1 change: 0 additions & 1 deletion docs/cplusplus/p0034.rst
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler
Includes
--------

- `digits.h <./digits.html>`__
- `math.h <./math.html>`__

Solution
2 changes: 1 addition & 1 deletion python/p0012.py
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ def main() -> int:
num = 0
for x in count(1):
num += x
if sum(1 for _ in proper_divisors(num)) > 499:
if sum(1 for _ in proper_divisors(num)) > 500:
return num
return -1

2 changes: 1 addition & 1 deletion rust/src/p0012.rs
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ pub fn p0012() -> i128 {
let mut num: u64 = 0;
for x in 1.. {
num += x;
if primes::proper_divisors(num).len() > 499 {
if primes::proper_divisors(num).len() > 500 {
return num.into();
}
}
2 changes: 1 addition & 1 deletion rust/src/p0015.rs
Original file line number Diff line number Diff line change
@@ -13,5 +13,5 @@ Find the sum of all the primes below two million.
use crate::math;

pub fn p0015() -> i128 {
return math::n_choose_r(40, 20).into();
return math::n_choose_r(40, 20);
}
2 changes: 1 addition & 1 deletion rust/src/p0076.rs
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ pub fn p0076() -> i128 {
idx += 1;
counts[idx] += idx as u64;
sum = counts.iter().sum();
if !(sum > 100) {
if sum <= 100 {
break;
}
}

0 comments on commit 3b3579d

Please sign in to comment.