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

Home > Numbers
my house's number II (Posted on 2012-10-27) Difficulty: 2 of 5
(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.)
Solution Another Computer solution Comment 3 of 3 |

Discussion below (not as efficient as Charlie's but serves the purpose).

OPEN "c:\qb64\work\address.txt" FOR OUTPUT AS #1

FOR a = 1 TO 9
 FOR b = 0 TO 9
  FOR c = 0 TO 9
   FOR d = 0 TO 9
    FOR n = 0 TO 100
     abcd = a * 10 ^ 3 + b * 10 ^ 2 + c * 10 + d
     p = a ^ b * c ^ d - n
     q = a ^ b * c ^ d + n
     IF abcd = p THEN
      PRINT "P"; abcd, n
      PRINT #1, "P"; abcd, n
     END IF
     IF abcd = q THEN
      PRINT "Q"; abcd, n
      PRINT #1, "Q"; abcd, n
     END IF

    NEXT
   NEXT
  NEXT
 NEXT
NEXT
CLOSE 1

Data from program:
Q 1045         21
P 1264         32
Q 1364         68
Q 2145         97
P 2534         58
P 2592         0
Q 2592         0
P 3055         70
Q 3145         73
P 3353         22
Q 3651         6
P 4046         50
P 4084         12
Q 4145         49
Q 5145         25
Q 6145         1
P 6451         29
P 7145         23
P 8145         47
Q 8227         35
P 9145         71

"m" and "n" are defined in the problem but no differentiation has been made in the program. such values need to be accounted for in the data list.
P is "my address"  and "n" is minimal but greater than 0.
Q is "my cousin" and "n" is minimal but greater than 1.

For those stipulations P is 4084 (n=12) and Q is 3651 (n=6).

  Posted by brianjn on 2012-10-28 20:47:24
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information