- #1

- 113

- 1

Find all integers a,b,c,d satisfying the following relations

i) [tex]1 \leq a \leq b \leq c \leq d[/tex]

ii) ab+cd = a+b+c+d+3

thanks

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter AlbertEinstein
- Start date

- #1

- 113

- 1

Find all integers a,b,c,d satisfying the following relations

i) [tex]1 \leq a \leq b \leq c \leq d[/tex]

ii) ab+cd = a+b+c+d+3

thanks

- #2

berkeman

Mentor

- 59,630

- 9,766

- #3

berkeman

Mentor

- 59,630

- 9,766

Well I got at least one solution in Excel. Now if I could prove that it's the only one.....

- #4

0rthodontist

Science Advisor

- 1,230

- 0

I got 4 solutions using Haskell

[[1,1,2,6],[1,2,2,6],[2,2,2,5],[2,2,3,3]]

These are the only solutions where all values are between 1 and 20. To show that they are they only four (which I'd guess they are) you can use an argument based on how fast ab + cd grows versus how fast a + b + c + d + 3 grows.

Incidentally, because I like to show off Haskell, this is what my code looks like

Then in the interpreter I just typed x.

[[1,1,2,6],[1,2,2,6],[2,2,2,5],[2,2,3,3]]

These are the only solutions where all values are between 1 and 20. To show that they are they only four (which I'd guess they are) you can use an argument based on how fast ab + cd grows versus how fast a + b + c + d + 3 grows.

Incidentally, because I like to show off Haskell, this is what my code looks like

Code:

```
-- f just generates all possible lists of length k where each element is at least as great as the next element.
-- I wanted to do this efficient-like, which is why this may be a little confusing.
f min n 0 = [[]]
f min n k = foldr (++) [] [[a:as | as <- (f a n (k-1))] | a <- [min..n]]
-- If I had done it the easy way instead of the efficient way using f
-- then then I would have just let x = [[a,b,c,d] | a<-[1..20],b<-[1..20],c<-[1..20],a*b+c*d==a+b+c+d+3 && a >= b && b >= c && c >= d]
-- and not defined f or y
y = f 1 20 4
x = [[a,b,c,d] | [a,b,c,d] <- y, a*b+c*d==a+b+c+d+3]
```

Last edited:

- #5

- 28

- 0

can you work out the rest.....????

Share: