OFFSET
1,2
COMMENTS
Same as the South spoke of the Champernowne spiral (A244677).
LINKS
Andrey Zabolotskiy, Table of n, a(n) for n = 1..10000
EXAMPLE
The spiral begins
.
3---1---4---1---5
| |
1 5---6---7 1
| | | |
2 4 1 8 6
| | | | |
1 3---2 9 1
| | |
1---1---0---1 7
.
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]]];
f[n_] := 4n^2 - 5n + 2; Array[ almostNatural[ f@#, 10] &, 105] (* Robert G. Wilson v, Aug 08 2014 *)
CROSSREFS
KEYWORD
nonn,base,easy,nice
AUTHOR
Olivier Gorin (gorin(AT)roazhon.inra.fr)
EXTENSIONS
More terms from Andrew J. Gacek (andrew(AT)dgi.net)
Edited by Charles R Greathouse IV, Nov 01 2009
STATUS
approved