OFFSET
1,2
FORMULA
Function selects the middle digit in n or, for even numbers, the digit to the right of the middle.
EXAMPLE
a(1) = 1.
a(12) = 2.
a(123) = 2.
a(1234) = 3.
MAPLE
A179636 := proc(n) dgs := convert(n, base, 10) ; l := nops(dgs) ; if type(l, 'odd' ) then dgs[(l+1)/2] ; else dgs[l/2] ; end if; end proc: seq(A179636(n), n=1..120); # R. J. Mathar, Jul 27 2010
MATHEMATICA
f[n_] := IntegerDigits[n][[ Floor[ (Log[10, n] + 1)/2] + 1]]; Array[f, 105] (* Robert G. Wilson v, Jul 25 2010 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Dominick Cancilla, Jul 21 2010
EXTENSIONS
More terms from R. J. Mathar and Robert G. Wilson v, Jul 27 2010
STATUS
approved