login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A237427 a(0)=0, a(1)=1; thereafter, if n is k-th ludic number [i.e., n = A003309(k)], a(n) = 1 + (2*a(k-1)); otherwise, when n is k-th nonludic number [i.e., n = A192607(k)], a(n) = 2*a(k). 26

%I #33 Oct 11 2021 04:50:22

%S 0,1,3,7,2,15,6,5,14,4,30,31,12,13,10,28,8,11,60,62,24,26,20,29,56,9,

%T 16,22,120,61,124,48,52,40,58,112,18,63,32,44,240,25,122,27,248,96,

%U 104,21,80,116,224,36,126,57,64,88,480,50,244,54,496,17,192,208,42

%N a(0)=0, a(1)=1; thereafter, if n is k-th ludic number [i.e., n = A003309(k)], a(n) = 1 + (2*a(k-1)); otherwise, when n is k-th nonludic number [i.e., n = A192607(k)], a(n) = 2*a(k).

%C Shares with permutation A237058 the property that all odd numbers occur in positions given by ludic numbers (A003309: 1, 2, 3, 5, 7, 11, 13, 17, ...), while the even numbers > 0 occur in positions given by nonludic numbers (A192607: 4, 6, 8, 9, 10, 12, 14, 15, 16, ...). However, instead of placing terms into those positions 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 A237058.

%C 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 ludic/nonludic numbers (A003309/A192607) is entangled with a complementary pair odd/even numbers (A005408/A005843).

%C Because 2 is the only even ludic number, it implies that, apart from a(2)=3, odd numbers occur in odd positions only (along with many even numbers that also occur in odd positions).

%H Antti Karttunen, <a href="/A237427/b237427.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(0)=0, a(1)=1; thereafter, if A192490(n) = 1 [i.e., n is ludic], a(n) = 1+(2*a(A192512(n)-1)); otherwise a(n) = 2*a(A236863(n)) [where A192512 and A236863 give the number of ludic and nonludic numbers <= n, respectively].

%e For n=2, with 2 being the second ludic number (= A003309(2)), the value is computed as 1+(2*a(2-1)) = 1+2*a(1) = 1+2 = 3, thus a(2)=3.

%e For n=3, with 3 being the third ludic number (= A003309(3)), the value is computed as 1+(2*a(3-1)) = 1+2*a(2) = 1+2*3 = 7, thus a(3)=7.

%e For n=4, with 4 being the first nonludic number (= A192607(1)), the value is computed as 2*a(1) = 2 = a(4).

%e For n=5, with 5 being the fourth ludic number (= A003309(4)), the value is computed as 1+(2*a(4-1)) = 1+2*a(3) = 1+2*7 = 15 = a(5).

%e For n=9, with 9 being the fourth nonludic number (= A192607(4)), the value is computed as 2*a(4) = 2*2 = 4 = a(9).

%t nmax = 100;

%t T = Range[2, nmax+7];

%t L = {1};

%t While[Length[T] > 0, With[{k = First[T]},

%t AppendTo[L, k]; T = Drop[T, {1, -1, k}]]];

%t nonL = Complement[Range[Last[L]], L];

%t a[n_] := a[n] = Module[{k}, Which[

%t n < 2, n,

%t IntegerQ[k = FirstPosition[L, n][[1]]], 1 + 2 a[k-1],

%t IntegerQ[k = FirstPosition[nonL, n][[1]]], 2 a[k],

%t True , Print[" error: n = ", n]]];

%t Table[a[n], {n, 0, nmax}] (* _Jean-François Alcover_, Oct 10 2021, after _Ray Chandler_ in A003309 *)

%o (Haskell)

%o import Data.List (elemIndex); import Data.Maybe (fromJust)

%o a237427 = (+ 1) . fromJust . (`elemIndex` a237126_list)

%o (Scheme, with Antti Karttunen's IntSeq-library for memoizing definec-macro)

%o (definec (A237427 n) (cond ((< n 2) n) ((= 1 (A192490 n)) (+ 1 (* 2 (A237427 (- (A192512 n) 1))))) (else (* 2 (A237427 (A236863 n))))))

%o ;; _Antti Karttunen_, Feb 07 2014

%Y Inverse permutation of A237126.

%Y Similar permutations: A135141/A227413, A243287/A243288, A243343-A243346.

%Y Cf. A003309, A192607, A192490, A192512, A236863.

%K nonn,look

%O 0,3

%A _Antti Karttunen_ and _Reinhard Zumkeller_, Feb 07 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 08:39 EDT 2024. Contains 371782 sequences. (Running on oeis4.)