![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Project Euler
文章平均质量分 65
贝乔
这个作者很懒,什么都没留下…
展开
-
PHP 和 Python实现Project Euler 1、2题
最近开始学python,于是就拿Project Euler来练手Problem 1If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Find the sum of al原创 2015-08-27 17:19:14 · 822 阅读 · 0 评论 -
Project Euler Problem 16
原题:215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 21000?由于2的1000次方是一个很大的数,远远超出范围,也因此一直没有好办法解这个题,最近看python,发现python对这个没有限制(刚原创 2015-08-13 18:01:12 · 533 阅读 · 0 评论 -
Python计算Project Euler Problem 3
最近学Python,于是就拿Project Euler里面的题来练手,以下是第三题:The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?既然是求质因子,首先想到的思路就是先求出来因子,再判断是不是质数,代码如下:num =原创 2015-09-01 09:36:01 · 684 阅读 · 0 评论 -
Python实现Project Euler 5
首先,来看题:2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the n原创 2015-09-02 10:02:32 · 769 阅读 · 0 评论 -
Project Euler Problems 19-22 Python实现
Project Euler Problem 19: 思路:本题是求从1901-01-01到2000-12-31这200年中有多少个星期天是一个月的第一天,例如1901-09-01这天是周日,同时也是9月第一天;所以我们可以先从年份开始循环,内层嵌套月份的循环,再对每月份的第一天进行判断是不是周日,是则统计加1,不是则跳过,代码如下:# coding utf-8# Desc原创 2015-12-22 11:54:06 · 631 阅读 · 0 评论 -
Project Euler 24 25
Lexicographic permutations原题目如下:A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are原创 2016-01-08 16:24:50 · 961 阅读 · 0 评论 -
Project Euler 25
1000-digit Fibonacci numberThe Fibonacci sequence is defined by the recurrence relation:Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.Hence the first 12 terms will be:F1 = 1F2 = 1F3 = 2F原创 2016-01-08 16:41:10 · 598 阅读 · 0 评论