# Difference between revisions of "Euler problems/161 to 170"

From HaskellWiki

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

Line 28: | Line 28: | ||

Solution: |
Solution: |
||

<haskell> |
<haskell> |
||

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

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

## Contents

## Problem 161

Triominoes

Solution:

```
problem_161 = undefined
```

## Problem 162

Hexadecimal numbers

Solution:

```
problem_162 = undefined
```

## Problem 163

Cross-hatched triangles

Solution:

```
problem_163 = undefined
```

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

## Problem 165

Intersections

Solution:

```
problem_165 = undefined
```

## Problem 166

Criss Cross

Solution:

```
problem_166 = undefined
```

## Problem 167

Investigating Ulam sequences

Solution:

```
problem_167 = undefined
```