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

Home > Numbers
Count the acceptable permutations (Posted on 2023-10-30) Difficulty: 3 of 5
How many permutations of the integers 1, 2, …, n are there such that every integer (last excluded) is followed by (not necessarily immediately) by an integer which differs from it by 1?

For example if n=4 the permutation 1432 is an acceptable one, while 2431 is not.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
re: Most of a proof | Comment 3 of 4 |
(In reply to Most of a proof by Larry)

Larry's proof works for me.  


We can prove by induction that the last k digits must be consective in some order:

The last 2 digits must be consecutive (in some order), because digit n-1 is 1 more or one less than digit n.

Then the last 3 digits must be consecutive (in some order) because digit n-2 is either 1 more than the maximum or 1 less than the minimum of the 2 consecutive digits that follow it.

Then the last 4 digits must be consecutive (in some order) because digit n-3 is either 1 more than the maximum or 1 less than the minimum of the 3 consecutive digits that follow it.

By induction, the last k digits must be consecutive (in some order) because digit n-(k-1) is either 1 more than the maximum or 1 less than the minimum of the (k-1) consecutive digits that follow it

And since the last n-1 digits are consecutive in some order, the first digit must either be 1 or n.

  Posted by Steve Herman on 2023-10-30 20:39:05
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 (7)
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