OFFSET
0,4
REFERENCES
W. Sierpiński, Cardinal and Ordinal Numbers, Warsaw 1965, 2nd ed., p. 40.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
MATHEMATICA
order[n_] := Join[-Reverse[ pos = Select[(r = Range[n])/Reverse[r], Numerator[#] + Denominator[#] == n + 1 & ] ], pos]; order[0] = 0; Numerator[ Flatten[ Table[ order[n], {n, 0, 10}]]] (* Jean-François Alcover, Jun 27 2012 *)
PROG
(Haskell)
import Data.List (transpose)
import Data.Ratio ((%), numerator)
a037161 n = a037161_list !! n
a037161_list = 0 : map numerator
(concat $ concat $ transpose [map (map negate) qss, map reverse qss])
where qss = map q [1..]
q x = map (uncurry (%)) $ filter ((== 1) . uncurry gcd) $
zip (reverse zs) zs where zs = [1..x]
-- Reinhard Zumkeller, Mar 08 2013
CROSSREFS
KEYWORD
sign,easy,nice,frac
AUTHOR
STATUS
approved