All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 my house's number II (Posted on 2012-10-27)
(i) My house's number can be written as ABCD and it equals (AB)*(CD) – n, where n is the minimum with n ≥ 1. Find the number.

(ii) My cousin's house's number can be written as ABCD and it equals (AB)*(CD) + m, where m is the minimum with m ≥ 2. Find the number.

Note: Each of A, B, C and D denotes a digit from 0 to 9 whether same or different; A is nonzero and, at least one of C and D is nonzero. Each of m and n is an integer. ABCD denotes the concatenation of the digits.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 3

DEFDBL A-Z
minn = 99999999: minm = minn
FOR a = 1 TO 9
FOR b = 0 TO 9
apb = INT(a ^ b + .5)
FOR c = 1 TO 9
FOR d = 0 TO 9
cpd = INT(c ^ d + .5)
abcd = 1000 * a + 100 * b + 10 * c + d
n = apb * cpd - abcd
IF n >= 1 THEN
IF n < minn THEN
minn = n
minna = a: minnb = b: minnc = c: minnd = d
END IF
END IF
m = abcd - apb * cpd
IF m >= 2 THEN
IF m < minm THEN
minm = m
minma = a: minmb = b: minmc = c: minmd = d
END IF
END IF
NEXT d
NEXT c
NEXT b
NEXT a

PRINT minna; minnb; minnc; minnd, minn
PRINT minma; minmb; minmc; minmd, minm

finds

4  0  8  4    12
3  6  5  1    6

which means:

(i) 4084 = 4^0 * 8^4 - 12

(ii) 3651 = 3^6 * 5^1 + 6

 Posted by Charlie on 2012-10-27 14:02:41

 Search: Search body:
Forums (0)