马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 冬雪雪冬 于 2017-10-3 19:02 编辑
从现在开始我们要开展一批欧拉计划的习题练习。
其实在我们论坛中已有欧拉计划的板块,可能有些鱼油还没注意到。
什么是欧拉计划:http://bbs.fishc.com/thread-60405-1-1.html
我们欧拉板块现已给出了200余题,这批练习将从欧拉计划中选题。其实用python语言完成有很多的优势,可以更简洁更方便的实现。
如果大家有兴趣也可浏览欧拉的英文网站:https://projecteuler.net/archives
这里已经有了500余题。
要求:
以python语言完成,如果是python2请注明。
程序以代码文字格式发帖。
注重程序效率和创意。
答题在一周内完成,即10.2 10:00之前,其后将公开大家的答案,并评比成绩。
另程序和答案可以在网上搜到,希望大家独立完成。题目不难,大家看看谁的效率高。
-- 回帖需写明解题思路,鼓励在程序中加上注释 --
-- 一些鱼油反映题目有些过难,为此略过一部分偏难的题目 --
297
齐肯多夫表示 斐波那契数列的每一项都由前两项相加而得。
从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,∑ z(n) = 7894453。 对于0<n<1017,求∑ 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) = 1, z(14) = 2, z(100) = 3 etc.
Also, for 0<n<106, ∑ z(n) = 7894453. Find ∑ z(n) for 0<n<1017.
|