読者です 読者をやめる 読者になる 読者になる

mu chance or much chance ?

日々の戯れ言

Project Euler 13

Problem13を解き直しました. Large sum Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 743249861995…

Project Euler 12

Problem12を解き直しました. Highly divisible triangular number 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 terms would be:1,…

Project Euler 11

Problem11を解きました. Largest product in a grid In the 20×20 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 …

Project Euler 10

Problem10を解き直しました. Summation of primes The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million. https://projecteuler.net/problem=10 問題は「2000000以下の全ての素数の総和を求めよ」. 解…

Project Euler 9

Problem9を解き直しました. Special Pythagorean triplet A Pythagorean triplet is a set of three natural numbers, a a^2 + b^2 = c^2For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.There exists exactly one Pythagorean triplet for which a + b + c = …

Project Euler 8

Problem8を解き直しました. Largest product in a series The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.73167176531330624919225119674426574742355349194934 969835203127745063262395783…

Project Euler 7

Problem7を解き直しました. 10001st prime 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 10001st prime number? https://projecteuler.net/problem=7 問題は「10001番目の素数を求め…

Project Euler 6

Problem6を解き直しました. Sum square difference The sum of the squares of the first ten natural numbers is,1^2 + 2^2 + ... + 10^2 = 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)^2 = 55^2 = 3025Hence the d…

Project Euler 5

Problem5を解き直しました. Smallest multiple 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 numbers from…

Project Euler 4

Problem4を解き直しました. Largest palindrome product 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…

Project Euler 3

Problem3を解き直しました. Largest prime factor The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ? https://projecteuler.net/problem=3 問題は「600851475143の素因数の最大値を求めよ」…

Project Euler 2

Problem2を解き直しました. Even Fibonacci numbers 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 consider…

Project Euler 1

前職時で主に使っていたC言語を使って解いていたのですが,転職の際に,忙しくて解くヒマも無かったので,現職で扱っているスクリプト言語で再度解き直そうと思います.まずはProblem1から. Multiples of 3 and 5 If we list all the natural numbers below…