Strange Counter

  • + 1 comment

    Simple C code:

    int i;
    long long int t,k=3;
    scanf("%lld",&t);
    while(k<t){
        t-=k;
        k*=2;
    }
    printf("%lld",k-t+1);
        return 0;