鱼C论坛

 找回密码
 立即注册
查看: 1606|回复: 0

[技术交流] 小练习结果揭晓:齐肯多夫表示

[复制链接]
发表于 2017-10-3 19:09:24 | 显示全部楼层 |阅读模式

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

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

x
原帖子:http://bbs.fishc.com/forum.php?m ... 1&extra=#pid3029818

齐肯多夫表示
斐波那契数列的每一项都由前两项相加而得。
从1和2开始,前10项是:1、2、3、5、8、13、21、34、55、89。
每一个正整数可以唯一地写成斐波那契数列中非连续项的和。例如,100 = 3 + 8 + 89。
这样的和被称为数的齐肯多夫表示。
对于任意整数n>0,记z(n)为n的齐肯多夫表示中的项数。
因此,z(5) = 1,z(14) = 2,z(100) = 3,等等。
此外,对于0<n<106,∑&#8201;z(n)&#8201;=&#8201;7894453。
对于0<n<1017,求∑&#8201;z(n)。

Zeckendorf Representation
Each new term in the Fibonacci sequence is generated by adding the previous two terms.
Starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.
Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, 100 = 3 + 8 + 89.
Such a sum is called the Zeckendorf representation of the number.
For any integer n>0, let z(n) be the number of terms in the Zeckendorf representation of n.
Thus, z(5)&#8201;=&#8201;1, z(14)&#8201;=&#8201;2, z(100)&#8201;=&#8201;3 etc.
Also, for 0<n<106, ∑&#8201;z(n)&#8201;=&#8201;7894453.
Find ∑&#8201;z(n) for 0<n<1017.


本题的正确答案是:2252639041804718029
回答正确的鱼油是:
jerryxjr1220    0.028s
gunjang          0.026s
两位鱼油都高效的完成了练习。

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-28 16:37

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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