OFFSET
0,3
COMMENTS
In one of Ross Honsberger's "Mathematical Gems" series (Dolciani Mathematical Expositions, Mathematical Association of America) there is a formula for extracting the n-th digit. Would someone submit it? [Robert Wilson notes that the Mathematica program below implements this formula.]
REFERENCES
Lucio Artiaga and Lloyd D. Davis, Algorithms and Their Computer Solutions, Merrill, 1972, p. 160.
M. Kraitchik, Mathematical Recreations. Dover, NY, 2nd ed., 1953, p. 49.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..1000
Sean A. Irvine, Java program (github)
MATHEMATICA
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[10^#, 10] &, 105, 0] (* modified by Robert G. Wilson v, Jul 15 2014 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Edited by Robert G. Wilson v, Jun 18 2002
STATUS
approved