reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
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]]]; Array[ almostNatural[2^#, 10] &, 105, 0] (* Robert G. Wilson v, Jun 27 2014 and modified July Jul 15 2014 *)
approved
editing
proposed
approved
editing
proposed
falmostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = 9 (b - 1) i*10b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + 10b^(i - 1); If[ p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, 10b]]]; Array[ falmostNatural[2^#, 10] &, 105, 0] (* Robert G. Wilson v, Jun 27 2014 and modified July 15 2014 *)
approved
editing
proposed
approved
editing
proposed
a(n) = A007376(2^n). - Robert Israel, Jun 27 2014
proposed
editing