Indeed. Asymptotically both are O(1), as the time taken is independent of input size (n).
However, the number of comparisons in the first case is a lot more than the second case (actually there's no comparison at all in the second case), thus the constant factor is larger in the first case. So second one is more efficient.
By the way, as far as i remember, this is the 'Multiples of 3 and 5' problem on ProjectEuler+.