鱼C论坛

 找回密码
 立即注册
查看: 2051|回复: 1

题目217:平衡数

[复制链接]
发表于 2017-1-5 15:33:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
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 的最小的数字,因此, ⌈π⌉ = 4 , ⌈5⌉ = 5。

比如,所有的回文数都是平衡数,还有像 13722 也是平衡数。

定义 T(n) 为小于 10n 的平衡数的和,已知:T(1) = 45,,T(2) = 540 ,T(5) = 334795890。

求 T(47) 模 315 的结果。

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-5-16 20:12:12 | 显示全部楼层
本帖最后由 永恒的蓝色梦想 于 2020-5-16 20:25 编辑

提供一点思路
如果 k 是奇数(k=1 时除外),那么 k 位的平衡数的数量是 k-1 位的平衡数的数量的 10 倍。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-1 14:28

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表