solutions: 63
This commit is contained in:
parent
0e85c328ba
commit
07f18be475
1 changed files with 15 additions and 0 deletions
15
src/bin/powerful_digit_counts.rs
Normal file
15
src/bin/powerful_digit_counts.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
use num_bigint::BigUint;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut count = 0;
|
||||||
|
for i in 1..=9 {
|
||||||
|
for j in 1..=100 {
|
||||||
|
let length = BigUint::from(i as u64).pow(j).to_string().len();
|
||||||
|
if length == j.try_into().unwrap() {
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{}", count);
|
||||||
|
}
|
Loading…
Reference in a new issue