cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A375184 In the binary expansion of n, complement bits at even positions and to the right of a 0 (the most significant bit corresponding to position 1).

This page as a plain text file.
%I A375184 #9 Aug 06 2024 16:38:41
%S A375184 0,1,2,3,4,5,6,7,9,8,10,11,13,12,14,15,18,19,16,17,20,21,22,23,26,27,
%T A375184 24,25,28,29,30,31,37,36,38,39,33,32,34,35,41,40,42,43,45,44,46,47,53,
%U A375184 52,54,55,49,48,50,51,57,56,58,59,61,60,62,63,74,75,72,73
%N A375184 In the binary expansion of n, complement bits at even positions and to the right of a 0 (the most significant bit corresponding to position 1).
%C A375184 This sequence is a self-inverse permutation of the nonnegative integers.
%H A375184 Rémy Sigrist, <a href="/A375184/b375184.txt">Table of n, a(n) for n = 0..8191</a>
%H A375184 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H A375184 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A375184 a(floor(n/2)) = floor(a(n)/2).
%e A375184 For n = 9: the binary expansion of 9 is "1001": the bit at position 2 (0) sits to the right of a 1 so we keep it, the bit at position 4 (1) sits to the right of a 0 so we complement it; the binary expansion of a(9) is "1000" and a(9) = 8.
%o A375184 (PARI) a(n) = { my (b = binary(n)); forstep (k = 2, #b, 2, if (!b[k-1], b[k] = 1-b[k];);); fromdigits(b, 2); }
%Y A375184 Cf. A063946, A165199, A375183.
%K A375184 nonn,base
%O A375184 0,3
%A A375184 _Rémy Sigrist_, Aug 03 2024