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

Home > Just Math
Going Maximum With Arithmetic (Posted on 2008-09-27) Difficulty: 3 of 5
Determine the maximum value of a (base ten) positive integer N (with non leading zeroes) such that each of the digits of N, with the exception of the first digit and the last digit, is less than the arithmetic mean of the two neighboring digits.

Note: Try to solve this problem analytically, although computer program/ spreadsheet solutions are welcome.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Down and up | Comment 2 of 5 |
We would like the number to have the maximal number of digits, and after that, to start with the highest digit possible. It's clear the number has at least 3 digits, as something like "986" works.

Call the first digit a, second digit b, and so on. Consider if a<=b. Then as b<(a+c)/2, we can see that c>2b-a. As b>=a, then b-a>=0, so 2b-a>=b. Thus, c>b. We can prove similarly that d>c, and so on. Thus all the numbers in this case must have digits in ascending order (excluding the first case)

However, none of these numbers can be the greatest number, as if we consider any number of at least three digits satisfying a<=b, then b<c, then the number formed by cabc... is greater, and as b>=a, and (a+c)/2>b, then (b+c)/2>=(a+c)/2>b>=a, so (b+c)/2>a. Thus, the number cabc... is another number satisfying the conditions.

Thus, we need only consider the numbers where a>b. Since a>b and c>2b-a (from (a+c)/2>b) c could be less than or greater than b. However, if c were greater than b, then as above, d>c, and so on, which would prevent the number from being the largest as long as we could find a c which was less than b instead. From this, we can see we want the number to be descending as long as possible, and then be equal or ascending as long as possible.

The condition (a+c)/2>b also implies a-b>b-c, and similarly b-c>c-d... These must be integer results, and must be different and positive. Trying a-b=4 (or a-b>4), starting with 9, we can see it's impossible to get 4 digits which are descending: 952... With a-b=3 we can get 4 digits: 9643... but we have to equal or ascend after that. Since we only had 4 digits coming down, we can only get 4 more digits going up (or equal) Since it still holds that d-e>e-f, it follows the reverse is the greatest ending possible. Thus, 96433469 is the largest such number.

  Posted by Gamer on 2008-09-27 19:26:45
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 (14)
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