• + 0 comments

    C++ solution:

    long strangeCounter(long t) {
        return 6*pow(2,floor(log2((1+(t-1)/3))))-2-t;
    }