# Euler problems/161 to 170

### From HaskellWiki

< Euler problems(Difference between revisions)

(Added problems 164-167) |
(Added problem_164) |
||

Line 28: | Line 28: | ||

Solution: | Solution: | ||

<haskell> | <haskell> | ||

− | problem_164 = | + | 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> | ||

## Revision as of 23:57, 10 November 2007

## Contents |

## 1 Problem 161

Triominoes

Solution:

problem_161 = undefined

## 2 Problem 162

Hexadecimal numbers

Solution:

problem_162 = undefined

## 3 Problem 163

Cross-hatched triangles

Solution:

problem_163 = undefined

## 4 Problem 164

Numbers for which no three consecutive digits have a sum greater than a given value.

Solution:

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]]

## 5 Problem 165

Intersections

Solution:

problem_165 = undefined

## 6 Problem 166

Criss Cross

Solution:

problem_166 = undefined

## 7 Problem 167

Investigating Ulam sequences

Solution:

problem_167 = undefined