`
gongzhq
  • 浏览: 22807 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 552 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum ...
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 number that is evenly divisible by all of the numbers from 1 to 20? 寻找能被1-20整除的最小数   答案:232792560 python code:    print  reduce(lambda x,y:x*y , [x**y fo ...
http://projecteuler.net/index.php?section=problems&id=4 projecteuler.net第四题 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91  99. Find the largest palindrome made from the product of two 3-digit numbers. ...
http://projecteuler.net/index.php?section=problems&id=3 projecteuler.net第三题 The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? 找出600851475143的最大质因数? 答案:6857   python code:          import sympy      max(sym ...
http://projecteuler.net/index.php?section=problems&id=2 projecteuler.net第二题 Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million. 求Fibonacci数列中小于4百万的偶数之和. 答案:4613732 python code:     def fibonacci(x):         a,b=0,1      ...
http://projecteuler.net/index.php?section=problems&id=1 projecteuler.net第一题 Add all the natural numbers below one thousand that are multiples of 3 or 5. 求1000以下的能被3或5整除的整数之和. 答案:233168 python code:      print sum(i for i in xrange(1000) if (i %3==0)or(i%5==0))
Global site tag (gtag.js) - Google Analytics