login
Median of the digits in n (rounding up).
2

%I #11 Feb 15 2025 16:26:49

%S 1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,

%T 5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,

%U 9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0

%N Median of the digits in n (rounding up).

%F Function selects the middle digit in n or, for n with an even number of digits, the digit to the right of the middle.

%e a(1) = 1.

%e a(12) = 2.

%e a(123) = 2.

%e a(1234) = 3.

%p 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

%t f[n_] := IntegerDigits[n][[ Floor[ (Log[10, n] + 1)/2] + 1]]; Array[f, 105] (* _Robert G. Wilson v_, Jul 25 2010 *)

%Y Cf. A179635.

%K easy,nonn,base

%O 1,2

%A _Dominick Cancilla_, Jul 21 2010

%E More terms from _R. J. Mathar_ and _Robert G. Wilson v_, Jul 27 2010