`
hotcharm
  • 浏览: 17110 次
  • 性别: Icon_minigender_1
  • 来自: 义乌
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
问题描述: The sequence of triangle numbers is generated by adding the natural numbers. So the 7thtriangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 13: 1,3 ...
问题描述: In the 2020 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 4 ...
问题描述: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 解决方案: (ns euler-problem-10.core (:use [clojure.contrib.math])) (defn prime? [num] (every? #(or (> (rem num %) 0) (= num %)) (apply list (range 2 (inc (ceil (sqrt num))))))) ; ...
问题描述: A Pythagorean triplet is a set of three natural numbers,abc, for which, a2+b2=c2 For example, 32+ 42= 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for whicha+b+c= 1000. Find the productabc. 解决方案: (ns euler-problem-9.core) (defn square [n] (* n n)) (defn p ...
问题描述: Find the greatest product of five consecutive digits in the 1000-digit number. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 12540698747158523863050715693290963295227443043557 6689 ...
问题描述: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number? 解决方案: (ns euler-problem-7.core (:use [clojure.contrib.math])) (defn prime? [num] (every? #(> (rem num %) 0) (apply list (range 2 (inc (ceil (sq ...
问题描述: 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 positive number that isevenly divisibleby all of the numbers from 1 to 20? 即求1到20的所有数的最小公倍数。 解决方案: (ns euler-problem-5.core (:use clojure.contrib.math)) ...
问题描述: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 9199. Find the largest palindrome made from the product of two 3-digit numbers. 解决方案: (ns euler-problem-4.core (:use clojure.contrib.math)) (defn palindromic- ...
问题描述: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? (ns euler-problem-3.core) (defn largest-prime-factor [number] (loop [current-num number,n 2,lpf 2] (if (>= lpf current-num) lpf (if (zero? (rem curren ...
问题描述: 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 ...
问题描述: If 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 all the multiples of 3 or 5 below 1000. 解决方案1: (defn sum-3-or-5-multiple-below [x] "If we list all the natural numbers below 10 that a ...
(define (square x) (* x x)) (define (smallest-divisor n) (find-divisor n 2)) (define (find-divisor n test-divisor) (cond ((> (square test-divisor) n) n) ((divides? test-divisor n) test-divisor) (else (find-divisor n (+ test-divisor 1))))) (define (divides? a ...
(define (square x) (* x x)) (define (smallest-divisor n) (find-divisor n 2)) (define (find-divisor n test-divisor) (cond ((> (square test-divisor) n) n) ((divides? test-divisor n) test-divisor) (else (find-divisor n (+ test-divisor 1))))) (define (divides? a ...
(define (gcd a b remainder-count) (if(= b 0) (begin (display "\nremainder count: ") (display remainder-count) (display "\n gcd result:") (display a) (display "\n") a) (gcd b (remainder ...
Global site tag (gtag.js) - Google Analytics