Puzzle posed and solved by Boyko Bantchev in the J programming forum on 2005-11-29.

Arrange a list of distinct positive integers so that no two numbers have their average between them in the sequence. For example, 6 2 10 8 5 is a correct ordering while 6 2 10 5 8 is not, since 5=-:+/2 8 and 5 is placed between 2 and 8 .

Solutions below.


































Solutions

/:~&.(|."1@#:)
/: |."1@#:

Puzzles/No Average Spanned (last edited 2008-12-08 10:45:54 by )