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

Home > Numbers
Consecutive digits (Posted on 2012-08-20) Difficulty: 1 of 5
(I) What is the largest 3-digit base ten positive integer such that when multiplied by a single digit, the result is a base ten 4-digit positive integer, with consecutive digits in order (example: 1234, 4567 etc, but not 0123 or, 7968)?

(II) What is the largest 3-digit base ten positive integer such that when multiplied by a single digit, the result is a base ten 4-digit positive integer, with consecutive digits in reverse order (example: 3210, 5432 etc, but not 9786)?

No Solution Yet Submitted by K Sengupta    
No Rating

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

DEFDBL A-Z
CLS
FOR n = 100 TO 999
 FOR mltplr = 2 TO 9
   prod = n * mltplr
   IF prod > 999 AND prod < 10000 THEN
     p$ = LTRIM$(STR$(prod))
     ascend = 1
     FOR i = 1 TO 3
      IF VAL(MID$(p$, i + 1, 1)) <> VAL(MID$(p$, i, 1)) + 1 THEN ascend = 0
     NEXT
     descend = 1
     FOR i = 1 TO 3
       IF VAL(MID$(p$, i + 1, 1)) <> VAL(MID$(p$, i, 1)) - 1 THEN descend = 0
     NEXT
     good = ascend OR descend
     IF good THEN
       PRINT n; "*"; mltplr; "="; prod;
       IF ascend THEN PRINT TAB(20); "asc.";
       IF descend THEN PRINT TAB(28); "desc.";
       PRINT
     END IF
   END IF
 NEXT mltplr
NEXT

finds

 335 * 7 = 2345    asc.
 384 * 9 = 3456    asc.
 432 * 8 = 3456    asc.
 469 * 5 = 2345    asc.
 535 * 6 = 3210            desc.
 576 * 6 = 3456    asc.
 617 * 2 = 1234    asc.
 642 * 5 = 3210            desc.
 679 * 8 = 5432            desc.
 727 * 9 = 6543            desc.
 776 * 7 = 5432            desc.
 864 * 4 = 3456    asc.
 


so the highest with a product in ascending order (I) is 864, and the highest whose product is in descending order (II) is 776.


  Posted by Charlie on 2012-08-20 12:26:50
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