feat(maths::solver): prime opti
This commit is contained in:
parent
75c1d0712b
commit
4ba6a65a71
|
@ -46,7 +46,7 @@ fn simplify_sqrt(mut n: i128) -> (i128, i128) {
|
|||
let mut prime_factors = vec![];
|
||||
let mut prime = 3;
|
||||
println!("stuck {n}");
|
||||
while n != 1 {
|
||||
while n != 1 && prime * prime < n {
|
||||
if n % (prime - 1) == 0 {
|
||||
println!("stuck {n} {}", prime - 1);
|
||||
prime_factors.push(prime - 1);
|
||||
|
|
Loading…
Reference in New Issue