Dec 12, 2015 17:52
Dammit :) I somehow misinterpreted the problem as "f(n) = 1 if there exists 0^N surrounded by non-zero digits". Heh.
Dec 12, 2015 17:52
@JeffE, just wondering: isn't there a third possibility, namely that there exists an infinite set S = {n1, n2, ... } for which 0^S{i} do appear in the representation, and infinite set Q = {m1, m2, ... } for which 0^Q{i} does not appear in the representation. Say, 0^N for every even N does appear, but 0^N for every odd N does not. Or any other rule you can come with. It seems this possibility isn't covered by two algorithms in your answers, is it? Or am I missing something obvious?