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$)
DEFLNG A-Z
CLS
a$ = "0123456789": h$ = a$
ct = 3628800
DO
  permute a$
  ct = ct - 1
LOOP UNTIL a$ = h$ OR ct = 200136
PRINT a$

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:
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 (12)
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