
Project Euler
lynne_cat
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
27 Quadratic primes - Project Euler
package xxx.xxx.xxx;import java.util.ArrayList;import java.util.Arrays;/* * Euler discovered the remarkable quadratic formula:n² + n + 41 * It turns out that the formula will produce原创 2015-11-04 14:53:08 · 352 阅读 · 0 评论 -
12 Highly divisible triangular number - Project Euler
package xxx.xxx.xxx;/* * The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. * The first ten term原创 2015-10-24 19:37:29 · 358 阅读 · 0 评论 -
13 Large sum - Project Euler
package xxx.xxx.xxx;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStreamReader;import java.math.BigInt原创 2015-10-24 20:02:33 · 265 阅读 · 0 评论 -
14 Longest Collatz sequence - Project Euler
package xxx.xxx.xxx;import java.math.BigInteger;import java.util.ArrayList;import java.util.Arrays;import java.util.List;/* * The following iterative sequence is defined for the se原创 2015-10-25 12:11:45 · 375 阅读 · 0 评论 -
16 Power digit sum - Project Euler
package xxx.xxx.xxx;import java.math.BigInteger;/* * 2^15 = 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? */public原创 2015-10-25 13:04:45 · 353 阅读 · 0 评论 -
20 Factorial digit sum - Project Euler
package xxx.xxx.xxx;import java.math.BigInteger;/* * n! means n × (n − 1) × ... × 3 × 2 × 1 * For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800, * and the sum of the digits in th原创 2015-10-26 22:33:23 · 332 阅读 · 0 评论 -
19 Counting Sundays - Project Euler
package xxx.xxx.xxx;import java.util.ArrayList;/* * You are given the following information, but you may prefer to do some research for yourself. * 1 Jan 1900 was a Monday. * Thirty原创 2015-10-28 10:06:57 · 453 阅读 · 0 评论 -
21 Amicable numbers - Project Euler
package xxx.xxx.xxx;/* * Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). * If d(a) = b and d(b) = a, where a ≠ b, then a and b are an ami原创 2015-10-28 10:45:05 · 308 阅读 · 0 评论 -
23 Non-abundant sums - Project Euler
package xxx.xxx.xxx;import java.util.HashSet;/* * A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. * For example, the sum of the pr原创 2015-10-31 15:20:45 · 314 阅读 · 0 评论 -
32 Pandigital products - Project Euler -
package xxx.xxx.xxx;import java.util.ArrayList;import java.util.HashSet;/* * We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; fo原创 2015-11-17 18:01:22 · 397 阅读 · 0 评论 -
25 1000-digit Fibonacci number - Project Euler
package xxx.xxx.xxx;import java.math.BigInteger;/* * The Fibonacci sequence is defined by the recurrence relation: * Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. * Hence the first 12 t原创 2015-11-01 22:55:32 · 304 阅读 · 0 评论 -
24 Lexicographic permutations - Project Euler +
package xxx.xxx.xxx;/* * 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 listed nu原创 2015-11-01 10:31:12 · 328 阅读 · 0 评论 -
9 Special Pythagorean triplet - Project Euler
package xxx.xxx.xxx;/* * A Pythagorean triplet is a set of three natural numbers, a * For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. * There exists exactly one Pythagorean triplet for which原创 2015-10-17 17:58:37 · 1874 阅读 · 0 评论 -
22 Names scores - Project Euler
package xxx.xxx.xxx;/* * Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. *原创 2015-10-29 21:30:25 · 330 阅读 · 0 评论 -
10 Summation of primes - Project Euler
package xxx.xxx.xxx;import java.math.BigInteger;/* * The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. * Find the sum of all the primes below two million. */public class Su原创 2015-10-18 22:30:22 · 317 阅读 · 0 评论 -
28 Number spiral diagonals - Project Euler +
package xxx.xxx.xxx;/* * Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:21 22 23 24 2520 7 8 9 1019 6 1 2 1118原创 2015-11-06 11:01:12 · 267 阅读 · 0 评论 -
1 Multiples of 3 and 5 - Project Euler
Multiples of 3 and 5Problem 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 all the multiple原创 2015-10-11 11:46:07 · 362 阅读 · 0 评论 -
2 Even Fibonacci numbers - Project Euler
package zml.algorithm.test;// 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,原创 2015-10-11 12:13:52 · 264 阅读 · 0 评论 -
3 Largest prime factor - Project Euler
Largest prime factorThe prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ?package zml.algorithm.test;import java.math.BigInteger原创 2015-10-12 20:52:57 · 318 阅读 · 0 评论 -
4 Largest palindrome product - Project Eulder
Largest palindrome productA 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 fr原创 2015-10-12 20:54:59 · 408 阅读 · 0 评论 -
5 Smallest multiple - Project Eulder
package xxx.xxx.xxx;import java.util.ArrayList;/* * 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 po原创 2015-10-13 22:38:10 · 334 阅读 · 0 评论 -
6 Sum square difference - Project Euler
package xxx.xxx.xxx;/* * The sum of the squares of the first ten natural numbers is,1^2 + 2^2 + ... + 10^2 = 385 * The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)^2原创 2015-10-14 10:55:16 · 384 阅读 · 0 评论 -
7 10001st prime - Project Euler
package xxx.xxx.xxx;public class NthtPrime {private void compute(int Nth) {int count = 2;int num = 3;label:while (true) {System.out.println(count);boolean isPrime = true;for原创 2015-10-14 11:37:21 · 304 阅读 · 0 评论 -
8 Largest product in a series - Project Euler
结论不正确,不知道为什么。package xxx.xxx.xxx;import java.util.ArrayList;/* * The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. * 7316原创 2015-10-15 11:17:40 · 505 阅读 · 0 评论 -
26 Reciprocal cycles - Project Euler
package xxx.xxx.xxx;/* * A unit fraction contains 1 in the numerator. * The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.原创 2015-11-03 13:27:45 · 377 阅读 · 0 评论