1.upto(?d){|n|i=n;i-=1while~-2**i%i>1-n%i;p i}