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

Home > Numbers
Tricky Ten Digit Number (Posted on 2006-07-31) Difficulty: 3 of 5
Find a number ABCDEFGHIJ, with all its digits different, such that:
  • A, C, E, G, and I are odd
  • HIJ is a multiple of BCD
  • GH is a multiple of AB
  • HIJ/BCD equals GH/AB

No Solution Yet Submitted by Yosippavar    
Rating: 4.2500 (4 votes)

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

DECLARE SUB permute (a$)
CLS
DEFDBL A-Z
odd$ = "13579": even$ = "02468"

oddH$ = odd$
DO

evenH$ = even$
DO
 hij$ = MID$(even$, 4, 1) + RIGHT$(odd$, 1) + RIGHT$(even$, 1)
 bcd$ = LEFT$(even$, 1) + MID$(odd$, 2, 1) + MID$(even$, 2, 1)
 gh$ = MID$(odd$, 4, 1) + MID$(even$, 4, 1)
 ab$ = LEFT$(odd$, 1) + LEFT$(even$, 1)
 IF VAL(gh$) / VAL(ab$) = VAL(hij$) / VAL(bcd$) THEN
   FOR i = 1 TO 5
     PRINT MID$(odd$, i, 1) + MID$(even$, i, 1);
   NEXT
   PRINT VAL(gh$) / VAL(ab$)
 END IF
 permute even$
LOOP UNTIL even$ = evenH$

 permute odd$
LOOP UNTIL odd$ = oddH$

finds all the cases where the given ratios are equal:

3218709654 3
3476905812 1.705882352941176
5812903476 .5862068965517241
9654703218 .3333333333333333

but the ratio of only the first is an integer, so that is the answer.


  Posted by Charlie on 2006-07-31 14:11:55
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 (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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