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.

A334727 Binary interpretation of the left diagonal of the XOR-triangle with first row generated from the binary expansion of n, with most significant bit given by first row.

This page as a plain text file.
%I A334727 #18 May 16 2020 16:03:06
%S A334727 0,1,3,2,7,6,5,4,15,14,12,13,10,11,9,8,31,30,29,28,25,24,27,26,21,20,
%T A334727 23,22,19,18,17,16,63,62,60,61,59,58,56,57,51,50,48,49,55,54,52,53,42,
%U A334727 43,41,40,46,47,45,44,38,39,37,36,34,35,33,32,127,126,125
%N A334727 Binary interpretation of the left diagonal of the XOR-triangle with first row generated from the binary expansion of n, with most significant bit given by first row.
%C A334727 This sequence is a self-inverse permutation of the nonnegative numbers, with only two fixed points: a(0) = 0 and a(1) = 1.
%H A334727 Rémy Sigrist, <a href="/A334727/b334727.txt">Table of n, a(n) for n = 0..8191</a>
%H A334727 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H A334727 <a href="/index/X#XOR-triangles">Index entries for sequences related to XOR-triangles</a>
%H A334727 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A334727 a(floor(n/2)) = floor(a(n)/2).
%F A334727 abs(a(2*n+1) - a(2*n)) = 1.
%F A334727 a(2^k) = 2^(k+1) - 1 for any k >= 0.
%F A334727 a(2^k-1) = 2^(k-1) for any k > 0.
%e A334727 For n = 42:
%e A334727 - the binary expansion of 42 is "101010",
%e A334727 - the corresponding XOR-triangle is:
%e A334727     1 0 1 0 1 0
%e A334727      1 1 1 1 1
%e A334727       0 0 0 0
%e A334727        0 0 0
%e A334727         0 0
%e A334727          0
%e A334727 - the bits on the left diagonal are: 1, 1, 0, 0, 0, 0,
%e A334727 - so a(42) = 2^5 + 2^4 = 48.
%o A334727 (PARI) a(n) = { my (v=0); forstep (x=#binary(n)-1, 0, -1, if (bittest(n, x), v+=2^x;); n=bitxor(n, n\2)); return (v) }
%Y A334727 See A334595 for a similar sequence.
%K A334727 nonn,base
%O A334727 0,3
%A A334727 _Rémy Sigrist_, May 09 2020