Difference between revisions of "Euler problems/71 to 80"

From HaskellWiki
Jump to navigation Jump to search
m (Corrected the links to Project Euler)
Line 1: Line 1:
 
[[Category:Programming exercise spoilers]]
 
[[Category:Programming exercise spoilers]]
== [http://projecteuler.net/index.php?section=problems&id=71 Problem 71] ==
+
== [http://projecteuler.net/index.php?section=view&id=71 Problem 71] ==
 
Listing reduced proper fractions in ascending order of size.
 
Listing reduced proper fractions in ascending order of size.
   
Line 8: Line 8:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=72 Problem 72] ==
+
== [http://projecteuler.net/index.php?section=view&id=72 Problem 72] ==
 
How many elements would be contained in the set of reduced proper fractions for d ≤ 1,000,000?
 
How many elements would be contained in the set of reduced proper fractions for d ≤ 1,000,000?
   
Line 16: Line 16:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=73 Problem 73] ==
+
== [http://projecteuler.net/index.php?section=view&id=73 Problem 73] ==
 
How many fractions lie between 1/3 and 1/2 in a sorted set of reduced proper fractions?
 
How many fractions lie between 1/3 and 1/2 in a sorted set of reduced proper fractions?
   
Line 24: Line 24:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=74 Problem 74] ==
+
== [http://projecteuler.net/index.php?section=view&id=74 Problem 74] ==
 
Determine the number of factorial chains that contain exactly sixty non-repeating terms.
 
Determine the number of factorial chains that contain exactly sixty non-repeating terms.
   
Line 32: Line 32:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=75 Problem 75] ==
+
== [http://projecteuler.net/index.php?section=view&id=75 Problem 75] ==
 
Find the number of different lengths of wire can that can form a right angle triangle in only one way.
 
Find the number of different lengths of wire can that can form a right angle triangle in only one way.
   
Line 52: Line 52:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=76 Problem 76] ==
+
== [http://projecteuler.net/index.php?section=view&id=76 Problem 76] ==
 
How many different ways can one hundred be written as a sum of at least two positive integers?
 
How many different ways can one hundred be written as a sum of at least two positive integers?
   
Line 60: Line 60:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=77 Problem 77] ==
+
== [http://projecteuler.net/index.php?section=view&id=77 Problem 77] ==
 
What is the first value which can be written as the sum of primes in over five thousand different ways?
 
What is the first value which can be written as the sum of primes in over five thousand different ways?
   
Line 68: Line 68:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=78 Problem 78] ==
+
== [http://projecteuler.net/index.php?section=view&id=78 Problem 78] ==
 
Investigating the number of ways in which coins can be separated into piles.
 
Investigating the number of ways in which coins can be separated into piles.
   
Line 76: Line 76:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=79 Problem 79] ==
+
== [http://projecteuler.net/index.php?section=view&id=79 Problem 79] ==
 
By analysing a user's login attempts, can you determine the secret numeric passcode?
 
By analysing a user's login attempts, can you determine the secret numeric passcode?
   
Line 84: Line 84:
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=80 Problem 80] ==
+
== [http://projecteuler.net/index.php?section=view&id=80 Problem 80] ==
 
Calculating the digital sum of the decimal digits of irrational square roots.
 
Calculating the digital sum of the decimal digits of irrational square roots.
   

Revision as of 13:54, 20 July 2007

Problem 71

Listing reduced proper fractions in ascending order of size.

Solution:

problem_71 = undefined

Problem 72

How many elements would be contained in the set of reduced proper fractions for d ≤ 1,000,000?

Solution:

problem_72 = undefined

Problem 73

How many fractions lie between 1/3 and 1/2 in a sorted set of reduced proper fractions?

Solution:

problem_73 = undefined

Problem 74

Determine the number of factorial chains that contain exactly sixty non-repeating terms.

Solution:

problem_74 = undefined

Problem 75

Find the number of different lengths of wire can that can form a right angle triangle in only one way.

Solution: This is only slightly harder than problem 39. The search condition is simpler but the search space is larger.

problem_75 = length . filter ((== 1) . length) $ group perims
    where  perims = sort [scale*p | p <- pTriples, scale <- [1..10^6 `div` p]]
           pTriples = [p |
                       n <- [1..1000],
                       m <- [n+1..1000],
                       even n || even m,
                       gcd n m == 1,
                       let a = m^2 - n^2,
                       let b = 2*m*n,
                       let c = m^2 + n^2,
                       let p = a + b + c,
                       p <= 10^6]

Problem 76

How many different ways can one hundred be written as a sum of at least two positive integers?

Solution:

problem_76 = undefined

Problem 77

What is the first value which can be written as the sum of primes in over five thousand different ways?

Solution:

problem_77 = undefined

Problem 78

Investigating the number of ways in which coins can be separated into piles.

Solution:

problem_78 = undefined

Problem 79

By analysing a user's login attempts, can you determine the secret numeric passcode?

Solution:

problem_79 = undefined

Problem 80

Calculating the digital sum of the decimal digits of irrational square roots.

Solution:

problem_80 = undefined