fix: n may be divisible by 2^...: not a bug(n==0) in this case