Showing posts with label Project Euler. Show all posts
Showing posts with label Project Euler. Show all posts

Friday, September 14, 2012

Project Euler Problem 12 Solution

project euler
Problem Link

Problem Statement
Find the smallest triangle number which has more than 500 divisors.First few triangle numbers are 1,3,6,10,15

Tuesday, December 27, 2011

Project Euler Problem 34 Solution

Problem Statement
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the sum of all numbers which are equal to the sum of the factorial of their digits.
Note: as 1! = 1 and 2! = 2 are not sums they are not included.

Tuesday, December 20, 2011

Project Euler Problem 179 Solution


Find the number of integers 1 < n < 107, for which n and n + 1 have the same number of positive divisors. For example, 14 has the positive divisors 1, 2, 7, 14 while 15 has 1, 3, 5, 15.

Thursday, December 15, 2011

Project Euler Problem 52 Solution


Problem Statement
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.

Saturday, December 3, 2011

Project Euler Problem 14 Solution

Problem Statement
The following iterative sequence is defined for the set of positive integers:
n → n/2 (n is even)
n → 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1
It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.
Which starting number, under one million, produces the longest chain?
NOTE: Once the chain starts the terms are allowed to go above one million.

Thursday, October 20, 2011

Project Euler Problem 77 Solution

Problem Description :
It is possible to write ten as the sum of primes in exactly five different ways:
7 + 3
5 + 5
5 + 3 + 2
3 + 3 + 2 + 2
2 + 2 + 2 + 2 + 2
What is the first value which can be written as the sum of primes in over five thousand different ways?

Tuesday, October 18, 2011

Project Euler Problem 47 Solution

Problem Statement :

     The first two consecutive numbers to have two distinct prime factors are:
14 = 2 × 7
15 = 3 × 5
The first three consecutive numbers to have three distinct prime factors are:
644 = 2² × 7 × 23
                               645 = 3 × 5 × 43
                               646 = 2 × 17 × 19.
Find the first four consecutive integers to have four distinct primes factors. What is the first of these numbers?

Tuesday, October 11, 2011

Project Euler Problem 50 Solution

Project Euler Problem 50 Solution

Problem Description :
     The prime 41, can be written as the sum of six consecutive primes:
41 = 2 + 3 + 5 + 7 + 11 + 13
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
The longest sum of consecutive primes below one-thousand that adds to a prime, contains 21 terms, and is equal to 953.
Which prime, below one-million, can be written as the sum of the most consecutive primes?

Saturday, October 8, 2011

Project Euler Problem 87 Solution

Project Euler Problem 87

Problem Description :
    
      The smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly four numbers below fifty that can be expressed in such a way:

Sunday, October 2, 2011

Project Euler Problem 37 Solution

Project Euler Problem 37 Solution


   Problem Description :

   The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.

Find the sum of the only eleven primes that are both truncatable from left to right and right to left.

NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes.

Saturday, October 1, 2011

Project Euler Problem 35 Solution

Project Euler Problem 35 Solution


Problem Description :
     The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.

There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.

How many circular primes are there below one million?

Wednesday, September 28, 2011

Project Euler Problem 41 Solution

Project Euler Problem 41 Solution

Problem Statement :

        We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
What is the largest n-digit pandigital prime that exists?