Additive primes: Difference between revisions
Content added Content deleted
m (→{{header|Rust}}: using rust v 1.58.0 features in print!() and println!()) |
|||
Line 2,657: | Line 2,657: | ||
let mut pms = Vec::with_capacity(limit / 2 - limit / 3 / 2 - limit / 5 / 3 / 2 + 1); |
let mut pms = Vec::with_capacity(limit / 2 - limit / 3 / 2 - limit / 5 / 3 / 2 + 1); |
||
let column_width = limit.to_string().len() + 1; |
let column_width = limit.to_string().len() + 1; |
||
print!("{: |
print!("{:column_width$}", 2); |
||
let mut count = 1; |
let mut count = 1; |
||
for u in (3..limit).step_by(2) { |
for u in (3..limit).step_by(2) { |
||
Line 2,688: | Line 2,688: | ||
Found 54 additive primes less than 500 |
Found 54 additive primes less than 500 |
||
</pre> |
</pre> |
||
===With crate "primal"=== |
===With crate "primal"=== |