Jump to content

Pythagorean quadruples: Difference between revisions

m
(fix tests, port another answer from scala)
m (→‎{{header|Rust}}: correction)
Line 1,779:
 
This is equivalent to https://oeis.org/A094958
which simply contains positive integers of the form 2^n or 5*2^n. Multiple implementations are provided.
 
<lang rust>
Line 1,794:
 
fn a094958_filter() -> Vec<u16> {
(1..2200) // ported from ScalaSidef
.filter(|n| ((n & (n - 1) == 0) || (n % 5 == 0 && ((n / 5) & (n / 5 - 1) == 0))))
.collect()
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.