OFFSET
0,3
COMMENTS
Shares with permutation A237056 the property that the other bisection consists of only ludic numbers and the other bisection of only nonludic numbers. However, instead of placing terms in those subsets in monotone order this sequence recursively permutes the order of both subsets with the emerging permutation itself, so this is a kind of "deep" variant of A237056.
Alternatively, this can be viewed as yet another "entanglement permutation", where two pairs of complementary subsets of natural numbers are entangled with each other. In this case a complementary pair odd/even numbers (A005408/A005843) is entangled with a complementary pair ludic/nonludic numbers (A003309/A192607).
LINKS
FORMULA
EXAMPLE
MATHEMATICA
nmax = 64;
T = Range[2, 20 nmax];
L = {1};
While[Length[T] > 0, With[{k = First[T]},
AppendTo[L, k]; T = Drop[T, {1, -1, k}]]];
nonL = Complement[Range[Last[L]], L];
a[n_] := a[n] = Which[
n < 2, n,
EvenQ[n] && a[n/2] <= Length[nonL], nonL[[a[n/2]]],
OddQ[n] && a[(n-1)/2]+1 <= Length[L], L[[a[(n-1)/2]+1]],
True, Print[" error: n = ", n, " size of T should be increased"]];
PROG
(Haskell)
import Data.List (transpose)
a237126 n = a237126_list !! n
a237126_list = 0 : es where
es = 1 : concat (transpose [map a192607 es, map (a003309 . (+ 1)) es])
-- Reinhard Zumkeller, Feb 10 2014, Feb 06 2014
(Scheme, with Antti Karttunen's IntSeq-library for memoizing definec-macro)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen and Reinhard Zumkeller, Feb 06 2014
STATUS
approved