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

Home > Just Math
The Descending Integers (Posted on 2006-02-02) Difficulty: 3 of 5
Let us consider all possible positive whole numbers (not containing any leading zeroes) with the proviso that in each of the numbers, none of its digits can be repeated.

Note: any given number may or may not contain all the digits from 0 to 9 (Examples: 7; 20; 1056; 3067941825 etc.)

These numbers are now arranged in descending order of magnitude.

What would be the 200,136th number?

See The Solution Submitted by K Sengupta    
Rating: 2.8000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: solution -- computer confirmation | Comment 3 of 8 |
(In reply to solution by Charlie)

By taking the permutations of all ten digits in ascending order of value, and counting down from 10! = 3628800, when we get to a count of 200136, that will be the 200,136th in descending order.

DECLARE SUB permute (a$)
a$ = "0123456789": h$ = a$
ct = 3628800
  permute a$
  ct = ct - 1
LOOP UNTIL a$ = h$ OR ct = 200136

The permute subroutine is shown elsewhere on this site.

The answer agrees, as 9403152678.

  Posted by Charlie on 2006-02-02 12:45:28
Please log in:
Remember me:
Sign up! | Forgot password

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

Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information