login
Permutation of natural numbers obtained by entangling even and odd numbers with Hofstadter's complementary pair A005228 & A030124; inverse permutation to A232752.
13

%I #22 Jun 06 2014 02:32:47

%S 0,1,3,2,7,5,15,6,11,31,13,23,4,63,27,47,9,127,14,55,95,19,255,29,111,

%T 191,10,39,511,59,223,383,21,79,1023,30,119,447,767,43,159,2047,61,

%U 239,895,12,1535,87,319,4095,123,479,1791,25,3071,175,22,639,8191

%N Permutation of natural numbers obtained by entangling even and odd numbers with Hofstadter's complementary pair A005228 & A030124; inverse permutation to A232752.

%C The permutation A135141 was obtained in analogous way by entangling even and odd numbers with primes and composites.

%C Note how all even numbers occur in positions given by A005228 from its second term 3 onward: 3, 7, 12, 18, 26, 35, 45, ... .

%C Note how all odd numbers occur in positions given by A030124: 2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, ... .

%C See also the comments in A232752.

%C Interesting observation: For all numbers of form (2^n)-1, from 7 onward, the next term in the sequence which has that (2^n)-1 as its proper prefix (in decimal notation), appears to be 10*((2^n)-1)+9. For example, a(4)=7 and a(33)=79 is the first term of more than one decimal digits beginning with 7. For the higher values of A000225, we have examples of a(6)=15 & a(40)=159, a(9)=31 & a(48)=319, a(13)=63 & a(57)=639, a(17)=127 & a(66)=1279, a(22)=255 & a(76)=2559, a(28)=511 & a(87)=5119, a(34)=1023 & a(99)=10239, a(41)=2047 & a(111)=20479, a(49)=4095 & a(124)=40959, a(58)=8191 & a(138)=81919, a(67)=16383 & a(153)=163839, a(77)=32767 & a(168)=327679, a(88)=65535 & a(184)=655359.

%C So while each A000225(n) occurs at positions given by sequence 1, 2, 4, 6, 9, 13, 17, 22, 28, 34, 41, 49, 58, 67, 77, 88, 100, 112, 125, 139, 154, 169, 185, 202, 220, 239, 258, 278, 299, 321, 344, 367, ... (which from 2 onward are A232739, the iterates of A030124, cf. comment at A232752), each (10*A000225(n))+9 occurs at positions given by sequence 21, 27, 33, 40, 48, 57, 66, 76, 87, 99, 111, 124, 138, 153, 168, 184, 201, 219, 238, 257, 277, 298, 320, 343, 366, 390, 415, 441, 468, 496, 524, 553, ... Note how these seem to be one less than the previous sequence shifted 7 steps left.

%H Antti Karttunen, <a href="/A232751/b232751.txt">Table of n, a(n) for n = 0..1557</a>

%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</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; for n > 1, when A232747(n)>0 (when n is in A005228), a(n) = 2*a(A232747(n)-1), otherwise (when n is in A030124) a(n) = (2*a(A232749(n))) + 1.

%F For all n >= 1, a(A232739(n)) = A000225(n+1).

%o (Scheme, with memoization macro definec from _Antti Karttunen_'s IntSeq-library)

%o (definec (A232751 n) (cond ((< n 2) n) ((not (zero? (A232747 n))) (* 2 (A232751 (- (A232747 n) 1)))) (else (+ 1 (* 2 (A232751 (A232749 n)))))))

%Y Inverse permutation: A232752.

%Y Cf. A135141, A005228, A030124, A005843 & A005408, A000079, A000225, A232747, A232749, A232739.

%Y Cf. also the permutation pair A167151 & A225850.

%K nonn,look

%O 0,3

%A _Antti Karttunen_, Nov 30 2013