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!)
A084483 If the rightmost block of zeros in binary representation of n has an even length, then delete one 0, otherwise insert one 0 in this block. 4

%I #18 Jul 23 2023 01:45:29

%S 1,4,3,2,9,12,7,16,5,20,19,6,25,28,15,8,33,36,11,10,41,44,39,48,13,52,

%T 51,14,57,60,31,64,17,68,67,18,73,76,23,80,21,84,83,22,89,92,79,24,97,

%U 100,27,26,105,108,103,112,29,116,115,30,121,124,63,32,129

%N If the rightmost block of zeros in binary representation of n has an even length, then delete one 0, otherwise insert one 0 in this block.

%H Amiram Eldar, <a href="/A084483/b084483.txt">Table of n, a(n) for n = 1..10000</a>

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

%F a(a(n)) = n, self-inverse permutation of natural numbers.

%F a(n) = n iff n = 2^k - 1, k>0.

%F -1 <= A023416(a(n)) - A023416(n) <= 1.

%F A000120(a(n)) = A000120(n).

%F A084484(n) = A007088(a(n)).

%F -1 <= A070939(a(n)) - A070939(n) <= 1.

%F a(2n+1) = 2a(n)+1, a(4n+2) = 8n+4, a(4n) = 2n(4-3*A035263(n)). - _Ralf Stephan_, Oct 09 2003

%e n = 43 in binary 101011: insert a 0 in the rightmost block of zeros consisting of one (odd!) 0: 1010011 -> 83 = a(43).

%e n = 41 in binary 101001: delete a 0 from the rightmost block of zeros consisting of two (even!) 0's: 10101 -> 21 = a(41).

%t a[n_] := a[n] = If[OddQ[n], 2*a[(n - 1)/2] + 1, If[EvenQ[IntegerExponent[n, 2]], n/2, 2*n]]; Array[a, 100] (* _Amiram Eldar_, Jul 22 2023 *)

%Y Cf. A000120, A007088, A023416, A035263, A070939, A084484.

%K nonn,base

%O 1,2

%A _Reinhard Zumkeller_, May 27 2003

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 25 10:01 EDT 2024. Contains 371967 sequences. (Running on oeis4.)