Groovy : 122 118118 111 chars
Golfed:
m=args[0] as int
a=[0]
(1..m-1).each{n->b=a[n-1];x=b-n;(x>0&(!a.contains(x) in a))?a[n]=x:(a[n]=b+n)}
a.each{print "$it "}
Ungolfed:
m = args[0] as int
a = [0]
(1..m-1).each { n->
b = a[n-1]
x = b-n
( x>0 & (!a.contains(x) in a) ) ? a[n] = x : (a[n] = b+n)
}
a.each{print "$it "}
Sample Run:
bash$ groovy Rec.groovy 14
0 1 3 6 2 7 13 20 12 21 11 22 10 23