makediv3 problem

why is the ans 105 not correct for n=3.like why the basic approach for checking an odd no and then condition no. divisible by 3 and not by 9 not working?

Check constraints you will get the answer.