OFFSET
1
MATHEMATICA
Transpose[ Partition[ Flatten[ IntegerDigits[Range@45, 2]], 2]][[1]] (* or *)
almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Table[almostNatural[n, 2], {n, 1, 210, 2}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Robert G. Wilson v, Jun 29 2014
STATUS
approved