The following is based on Waring's Problem: For all n floor((3/2)^n) + 3^n mod 2^n < 2^n. Kubina has tested this up to 471,600,000. x = 9; for( y = 4 ; x/y + x%y < y ; y *= z ) x *= 3; Assume that x and y are int's with unlimited size.