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.

A355487 Bitwise XOR of the base-4 digits of n.

This page as a plain text file.
%I A355487 #17 Jul 06 2022 22:19:06
%S A355487 0,1,2,3,1,0,3,2,2,3,0,1,3,2,1,0,1,0,3,2,0,1,2,3,3,2,1,0,2,3,0,1,2,3,
%T A355487 0,1,3,2,1,0,0,1,2,3,1,0,3,2,3,2,1,0,2,3,0,1,1,0,3,2,0,1,2,3,1,0,3,2,
%U A355487 0,1,2,3,3,2,1,0,2,3,0,1,0,1,2,3,1,0,3
%N A355487 Bitwise XOR of the base-4 digits of n.
%C A355487 Equivalently, the parity of the odd position 1-bits of n and the parity of the even position 1-bits of n, combined as a(n) = 2*A269723(n) + A341389(n).
%C A355487 In GF(2)[x] polynomials encoded as bits of an integer (least significant bit for the constant term), a(n) is remainder n mod x^2 + 1.
%H A355487 Kevin Ryde, <a href="/A355487/b355487.txt">Table of n, a(n) for n = 0..8192</a>
%H A355487 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%F A355487 Fixed point of the morphism 0 -> 0,1; 1 -> 2,3; 2 -> 1,0; 3 -> 3,2 starting from 0.
%e A355487 n=35 has base-4 digits 203 so a(35) = 2 XOR 0 XOR 3 = 1.
%t A355487 a[n_] := BitXor @@ IntegerDigits[n, 4]; Array[a, 100, 0] (* _Amiram Eldar_, Jul 05 2022 *)
%o A355487 (PARI) a(n) = if(n==0,0, fold(bitxor,digits(n,4)));
%o A355487 (Python)
%o A355487 from operator import xor
%o A355487 from functools import reduce
%o A355487 from sympy.ntheory import digits
%o A355487 def a(n): return reduce(xor, digits(n, 4)[1:])
%o A355487 print([a(n) for n in range(87)]) # _Michael S. Branicky_, Jul 05 2022
%Y A355487 Cf. A030373 (base 4 digits), A003987 (XOR).
%Y A355487 Cf. A341389, A269723, A010060.
%Y A355487 Cf. A353167 (indices of 0's).
%Y A355487 Other digit operations: A053737 (sum), A309954 (product).
%K A355487 nonn,base,easy
%O A355487 0,3
%A A355487 _Kevin Ryde_, Jul 04 2022