码迷,mamicode.com
首页 > 编程语言 > 详细

PYTHON--欧拉习题二

时间:2016-04-26 22:22:24      阅读:385      评论:0      收藏:0      [点我收藏+]

标签:欧拉 python

练习题来源:

https://projecteuler.net/archives

Problem 2

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.


问题2:

   斐波那契数列的规则是:后一个数字是前两个数字之和,如前十个斐波那契数列为:

        1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

   那么根据其规律,找出400,0000以内的斐波那契数,计算其偶数之和


本文出自 “三十男人学运维” 博客,请务必保留此出处http://loyfee.blog.51cto.com/754862/1767955

PYTHON--欧拉习题二

标签:欧拉 python

原文地址:http://loyfee.blog.51cto.com/754862/1767955

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!