Java 8, 57 56 55 50 bytes
#Java 8, 57 56 55 50 bytes
Thanks to @Numberknot for 1 byte
Thanks to @Kevin Cruijssen for 5 bytes
i->{for(;++i%3<1|(i+"").contains("3"););return i;}
This is a Function<Integer, Integer>
Explanation
Naive implementation that simply increments until it reaches an acceptable number.
Test Class
public class CodeGolf {
public static void main(String[] args) {
Function<Integer, Integer> countingGame = i->{for(;++i%3<1|(i+"").contains("3"););return i;};
int val = 1;
for (int i = 0; i < 10; i++) {
System.out.print(val + " ");
val = countingGame.apply(val);
}
}
}
Output of Test Class:
1 2 4 5 7 8 10 11 14 16