Maybe this is obvious, but does 'lexicographic order' include delimiters?

Does {102,41...} sort before or after {1024,2...}?

## Problem 524

**Forum rules**

As your posts will be visible to the general public you

are requested to be thoughtful in not posting anything

that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one

See also the topics:

Don't post any spoilers

Comments, questions and clarifications about PE problems.

### Re: Problem 524

No. You're ordering the permutations as lists, not as alphanumeric strings.

### Re: Problem 524

Just to be absolutely clear: the lexicographic order for the numbers from 1 to 20 is

1,10,11,12,13,14,15,16,17,18,19,2,20,3,4,5,6,7,8,9. Do we agree??

1,10,11,12,13,14,15,16,17,18,19,2,20,3,4,5,6,7,8,9. Do we agree??

### Re: Problem 524

No.phsr wrote:Just to be absolutely clear: the lexicographic order for the numbers from 1 to 20 is

1,10,11,12,13,14,15,16,17,18,19,2,20,3,4,5,6,7,8,9. Do we agree??

Think of each number in a list as a single letter in a word.

(2,3,4)<(10,1,1)<(10,1,2)<(10,4,1)<(11,3,3)<(104,1,2)<(1030,0,0)

Each 'coordinate' is sorted numerically, and lexicographic refers to how you deal with more than one coordinate - left to right, until the first coordinate where there is a difference, just like the letters of a word when sorting alphabetically.

https://en.wikipedia.org/wiki/Lexicographical_order

_{Jaap's Puzzle Page}

### Re: Problem 524

Do people think that this problem is solvable with just pencil and paper?

I thought I had found a pencil and paper solution, but it's wrong.

*EDIT*: Not

*EDIT* SOLVED with pencil and paper and calculator.

I thought I had found a pencil and paper solution, but it's wrong.

*EDIT*: Not

**just**pencil and paper. I need some computing power to deal with quite large numbers.*EDIT* SOLVED with pencil and paper and calculator.