Difference between revisions of "Euler problems/171 to 180"

From HaskellWiki
Jump to navigation Jump to search
 
(add problem 173)
Line 1: Line 1:
== [http://projecteuler.net/index.php?section=problems&id=161 Problem 161] ==
+
== [http://projecteuler.net/index.php?section=problems&id=171 Problem 171] ==
  +
Finding numbers for which the sum of the squares of the digits is a square.
Triominoes
 
   
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_161 = undefined
+
problem_171 = undefined
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=162 Problem 162] ==
+
== [http://projecteuler.net/index.php?section=problems&id=172 Problem 172] ==
  +
Investigating numbers with few repeated digits.
Hexadecimal numbers
 
   
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_162 = undefined
+
problem_172 = undefined
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=163 Problem 163] ==
+
== [http://projecteuler.net/index.php?section=problems&id=173 Problem 173] ==
  +
Using up to one million tiles how many different "hollow" square laminae can be formed?
Cross-hatched triangles
 
 
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
  +
problem_173=
problem_163 = undefined
 
  +
let c=div (10^6) 4
  +
xm=floor$sqrt $fromIntegral c
 
k=[div c x|x<-[1..xm]]
  +
in sum k-(div (xm*(xm+1)) 2)
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=164 Problem 164] ==
+
== [http://projecteuler.net/index.php?section=problems&id=174 Problem 174] ==
  +
Counting the number of "hollow" square laminae that can form one, two, three, ... distinct arrangements.
Numbers for which no three consecutive digits have a sum greater than a given value.
 
   
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
 
problem_174 = undefined
addDigit x = [[sum [x !! b !! c | c <- [0..9-a-b]] | b <- [0..9-a]] | a<-[0..9]]
 
x3 = [[10-a-b | b <- [0..9-a]] | a <- [0..9]]
 
x20 = iterate addDigit x3 !! 17
 
problem_164 = sum [x20 !! a !! b | a <- [1..9], b <- [0..9-a]]
 
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=165 Problem 165] ==
+
== [http://projecteuler.net/index.php?section=problems&id=175 Problem 175] ==
 
Fractions involving the number of different ways a number can be expressed as a sum of powers of 2.
Intersections
 
 
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_165 = undefined
+
problem_175 = undefined
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=166 Problem 166] ==
+
== [http://projecteuler.net/index.php?section=problems&id=176 Problem 176] ==
  +
Rectangular triangles that share a cathetus.
Criss Cross
 
 
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
  +
problem_176 = undefined
problem_166 =
 
sum [ product (map count [[0, c, b-d, a-b-d],
 
[0, b-a, c+d-a, b+d-a],
 
[0, -b-c, a-b-c-d, -c-d],
 
[0, a, d, c+d]])|
 
a <- [-9..9],
 
b <- [-9+a..9+a],
 
c <- [-9..9],
 
d <- [-9+a-c..9+a-c]]
 
where
 
count xs
 
|u<l=0
 
|otherwise=u-l+1
 
where
 
l = -minimum xs
 
u = 9-maximum xs
 
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=167 Problem 167] ==
+
== [http://projecteuler.net/index.php?section=problems&id=177 Problem 177] ==
  +
Integer angled Quadrilaterals.
Investigating Ulam sequences
 
   
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_167 = undefined
+
problem_177 = undefined
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=168 Problem 168] ==
+
== [http://projecteuler.net/index.php?section=problems&id=178 Problem 178] ==
  +
Step Numbers
Number Rotations
 
 
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_168 = undefined
+
problem_178 = undefined
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=169 Problem 169] ==
+
== [http://projecteuler.net/index.php?section=problems&id=179 Problem 179] ==
  +
Consecutive positive divisors.
Exploring the number of different ways a number can be expressed as a sum of powers of 2.
 
 
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_169 = undefined
+
problem_179 = undefined
 
</haskell>
 
</haskell>
   
== [http://projecteuler.net/index.php?section=problems&id=170 Problem 170] ==
+
== [http://projecteuler.net/index.php?section=problems&id=180 Problem 180] ==
Find the largest 0 to 9 pandigital that can be formed by concatenating products.
 
   
 
Solution:
 
Solution:
 
<haskell>
 
<haskell>
problem_170 = undefined
+
problem_180 = undefined
 
</haskell>
 
</haskell>

Revision as of 13:27, 28 January 2008

Problem 171

Finding numbers for which the sum of the squares of the digits is a square.

Solution:

problem_171 = undefined

Problem 172

Investigating numbers with few repeated digits.

Solution:

problem_172 = undefined

Problem 173

Using up to one million tiles how many different "hollow" square laminae can be formed? Solution:

problem_173=
    let c=div (10^6) 4
        xm=floor$sqrt $fromIntegral c
        k=[div c x|x<-[1..xm]]
    in  sum k-(div (xm*(xm+1)) 2)

Problem 174

Counting the number of "hollow" square laminae that can form one, two, three, ... distinct arrangements.

Solution:

problem_174 = undefined

Problem 175

Fractions involving the number of different ways a number can be expressed as a sum of powers of 2. Solution:

problem_175 = undefined

Problem 176

Rectangular triangles that share a cathetus. Solution:

problem_176 = undefined

Problem 177

Integer angled Quadrilaterals.

Solution:

problem_177 = undefined

Problem 178

Step Numbers Solution:

problem_178 = undefined

Problem 179

Consecutive positive divisors. Solution:

problem_179 = undefined

Problem 180

Solution:

problem_180 = undefined