%N The ordering of expressions built from numbers 2 and exponentiations according to their numeric values.
%C Let S be the sequence of all possible expressions built from numbers 2 and exponentiations (^), sorted according to their natural structural ordering (2, 2^2, 2^(2^2), (2^2)^2, 2^(2^(2^2)), 2^((2^2)^2) and so on - see the exact definition in Haskell below).
%C Let S' be S stable-sorted according to the numeric values of its elements in ascending order (the stable sorting is a sorting that keeps the order of elements with equal keys - so 2^(2^2) and (2^2)^2 will be kept in the original order).
%C This sequence is S' where each expression is replaced with its original index (1-based) in S; it is a permutation of the natural numbers sequence.
%o (Haskell) data Expr = Two | Expr :^: Expr
%o -- needed only for presentation
%o instance Show Expr where show Two = "2"; show (x :^: y) = "(" ++ show x ++ "^" ++ show y ++ ")"
%o ofSize 1 = [Two]
%o ofSize n = [left :^: right | k <- [1..n-1], left <- ofSize k, right <- ofSize (n-k)]
%o -- this defines the S sequence
%o s = [e | n <- [1..], e <- ofSize n]
%A _Vladimir Reshetnikov_, May 01 2010
%E First 100 terms from _D. S. McNeil_, May 04 2010