It's been a while since I've put out a puzzle.  Here's a new one:

Write a program that accepts a single argument n and outputs a
minimal length sequence of values from 1 to n where every (ordered)
pair of different values appears as adjacent elements somewhere
in the sequence.

For example, for n=3, one such sequence is:

    1 2 3 2 1 3 1

which includes all six pairs:

    1 2
    1 3
    2 1
    2 3
    3 1
    3 2

(with no duplicates and no other pairs, hence it must be minimal).

Feel free to add your solution to the "Pairing Up" Programming
Doodle wiki topic found under "Fun and Games" at:

    https://tapestry.tucson.az.us/unicon

(You'll have to *both* register *and* send me email to be
able to edit the topic - that's to keep the wiki clean...)

Or, email it to me and I'll add it for you.

-- 
Steve Wampler -- [EMAIL PROTECTED]
The gods that smiled on your birth are now laughing out loud.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to