+ a b b c c d d a 0 + d c c b b a 0 a d
If a , b , c and d are not necessarily distinct single-digit positive integers so that the result of both additions is the same, find the number of possible quadruples ( a , b , c , d ) .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
@Julian Poon , is this solvable without CS?
Log in to reply
Yes. I forgot how but it involves combinatorics. I also see that the inspiration has been changed to link to the same problem, neither did I add that the problem is original, because it is not, it was inspired by nihar's problem. If I'm not wrong it can be solved by noticing that c + d = b + a
Log in to reply
Can you show us how it's done? I have a solution, but that involved plenty of case checking which should be avoided.
Log in to reply
@Pi Han Goh – You can see Jon's report on this problem.
I solved it without programming but, unfortunately, after viewing the answer.
First of all, I noted that it is neccessary that
a
+
b
=
c
+
d
.
Now, First of all, all palindromes and nos. of the form
a
b
a
b
are solutions ,totalling to: 81+72=153.
Now, coming to the cases where a,b,c,d are distinct:
There are 34 cases with 8 arrangement each totalling to 272.
Now, there are 16 cases with a=b but not equal to c or d; with 4 arrangements each totalling to 64.
Hence, total no. Of solutions is 272+64+153 =
4
8
9
.
P.S. : I just wanted to tell my way. Sorry for any disturbance caused.
Using the legendary minizinc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Let your program do it for you.. :P
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Problem Loading...
Note Loading...
Set Loading...
Using Python 3:
Then we get 489.