0%

Problem 217


Problem 217


Balanced Numbers

A positive integer with k (decimal) digits is called balanced if its first ⌈k/2⌉ digits sum to the same value as its last ⌈k/2⌉ digits, where ⌈x⌉, pronounced ceiling of x, is the smallest integer ≥ x, thus ⌈π⌉ = 4 and ⌈5⌉ = 5.

So, for example, all palindromes are balanced, as is 13722.

Let T(n) be the sum of all balanced numbers less than 10n.
Thus: T(1) = 45, T(2) = 540 and T(5) = 334795890.

Find T(47) mod 315.


平衡数

如果一个k位(十进制)正整数,其前⌈k/2⌉个数字之和等于其后⌈k/2⌉个数字之和,则称之为平衡数。这里⌈x⌉表示x的上取整函数,也就是≥ x的最小整数,例如⌈π⌉ = 4以及⌈5⌉ = 5。

举例来说,所有的回文数都是平衡数;13722也是平衡数。

记T(n)是所有小于10n的平衡数之和。
因此:T(1) = 45,T(2) = 540以及T(5) = 334795890。

求T(47) mod 315