You are viewing a single comment's thread. Return to all comments →
Java solution:
public static long cycleLength(long t){ long sum = 0; long len = 3; while(true){ sum = sum +len; if(sum >= t) return len; len = len * 2; } } public static long strangeCounter(long t) { return 2 * cycleLength(t) - t - 2; }
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
Java solution: