fn solve(mut n: usize)->usize{ let mut x=0; while n&1==0{ x+=1; n>>=1; } x } fn validate(n: usize, x: usize){ assert_eq!((n-2_usize.pow(x as u32))%2_usize.pow(x as u32+1),0) } fn main() { for n in 1..65536{ //println!("{}", solve(i)); let x=solve(n); validate(n, x); } }