oracle数据库求回文数,Euler Project 挨个做 - 之一(Q1-50)

Euler Project 问题链接:

http://projecteuler.net/index.php?section=problems&page=1

准备挨个自己独立思考做一遍。

做题限于在Oracle数据库范围内, 优先顺序: 普通SQL -> 递归SQL -> PL/SQL -> Java -> 借助物理表

做的过程中,除了结果外,会把思路讲出来。

碰到及其难的,先跳过。

解题汇总:

Q1 Add all the natural numbers below one thousand that are multiples of 3 or 5.   #2

Q2 Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million.  #3

Q3 Find the largest prime factor of a composite number.    #4

Q4 Find the largest palindrome made from the product of two 3-digit numbers. #5

Q5 What is the smallest number divisible by each of the numbers 1 to 20?       #14

Q6 What is the difference between the sum of the squares and the square of the sums?  #16

Q7 Find the 10001st prime.    #17

Q8 Discover the largest product of five consecutive digits in the 1000-digit number.  #21

Q9 Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000.  #24

Q10 Calculate the sum of all the primes below two million. #26

Q11 What is the greatest product of four numbers on the same straight line in the 20 by 20 grid? #31

Q12 What is the value of the first triangle number to have over five hundred divisors? #32

Q13 Find the first ten digits of the sum of one-hundred 50-digit numbers.  #43

Q14 Find the longest sequence using a starting number under one million. #44

Q15 Starting in the top left corner in a 20 by 20 grid, how many routes are there to the bottom right corner?  #67

Q16 What is the sum of the digits of the number 2^1000?  #81

Q17 How many letters would be needed to write all the numbers in words from 1 to 1000?  #82

Q18 Find the maximum sum travelling from the top of the triangle to the base.  #92

Q19 How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?  #96

Q20 Find the sum of digits in 100! #97

Q21 Evaluate the sum of all the amicable numbers under 10000. #98

Q22 What is the total of all the name scores in the file of first names? #108

Q23 Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers. #112

Q24 What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9? #116

Q25 What is the first term in the Fibonacci sequence to contain 1000 digits?  #121

Q26 Find the value of d < 1000 for which 1/d contains the longest recurring cycle. #123

Q27 Find a quadratic formula that produces the maximum number of primes for consecutive values of n. #130

Q28 What is the sum of both diagonals in a 1001 by 1001 spiral? #138

Q29 How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100? #140

Q30 Find the sum of all the numbers that can be written as the sum of fifth powers of their digits. #143

Q31 Investigating combinations of English currency denominations. #147

Q32 Find the sum of all numbers that can be written as pandigital products. #161

Q33 Discover all the fractions with an unorthodox cancelling method. #164

Q34  Find the sum of all numbers which are equal to the sum of the factorial of their digits. #166

Q35 How many circular primes are there below one million? #169

Q36 Find the sum of all numbers less than one million, which are palindromic in base 10 and base 2. #177

Q37 Find the sum of all eleven primes that are both truncatable from left to right and right to left. #192

Q38 What is the largest 1 to 9 pandigital that can be formed by multiplying a fixed number by 1, 2, 3, ... ? #200

Q39 If p is the perimeter of a right angle triangle, {a, b, c}, which value, for p ≤ 1000, has the most solutions? #204

Q40 Finding the nth digit of the fractional part of the irrational number. #205

Q41 What is the largest n-digit pandigital prime that exists?  #209

Q42 How many triangle words does the list of common English words contain? #221

Q43 Find the sum of all pandigital numbers with an unusual sub-string divisibility property. #224

Q44 Find the smallest pair of pentagonal numbers whose sum and difference is pentagonal. #229

Q45  After 40755, what is the next triangle number that is also pentagonal and hexagonal? #236

Q46 What is the smallest odd composite that cannot be written as the sum of a prime and twice a square? #240

Q47  Find the first four consecutive integers to have four distinct primes factors. #249

Q48  Find the last ten digits of 11 + 22 + ... + 10001000.  #255

Q49 Find arithmetic sequences, made of prime terms, whose four digits are permutations of each other.  #260

Q50 Which prime, below one-million, can be written as the sum of the most consecutive primes?  #262

Q51-?  Euler Project 挨个做- 之二 (Q51-?)

[本帖最后由 tree_new_bee 于 2011-1-3 22:50 编辑]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值