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.

A268386 a(n) = A193231(A268387(n)).

This page as a plain text file.
%I A268386 #26 Jun 19 2020 04:21:27
%S A268386 0,1,1,3,1,0,1,2,3,0,1,2,1,0,0,5,1,2,1,2,0,0,1,3,3,0,2,2,1,1,1,4,0,0,
%T A268386 0,0,1,0,0,3,1,1,1,2,2,0,1,4,3,2,0,2,1,3,0,3,0,0,1,3,1,0,2,6,0,1,1,2,
%U A268386 0,1,1,1,1,0,2,2,0,1,1,4,5,0,1,3,0,0,0,3,1,3,0,2,0,0,0,5,1,2,2,0,1,1,1,3,1,0,1,1,1,1,0,4,1,1,0,2,2,0,0,2
%N A268386 a(n) = A193231(A268387(n)).
%H A268386 Antti Karttunen, <a href="/A268386/b268386.txt">Table of n, a(n) for n = 1..16384</a>
%F A268386 The following two formulas are equivalent because A193231 distributes over bitwise XOR (A003987):
%F A268386 a(n) = A193231(A268387(n)) and
%F A268386 a(n) = A268387(A268385(n)).
%F A268386 a(2^k) = A193231(k). - _Peter Munn_, May 07 2020
%F A268386 From _Peter Munn_, Jun 02 2020: (Start)
%F A268386 Alternative definition, for n, k >= 1, where XOR denotes A003987:
%F A268386 a(prime(n)) = 1, where prime(n) = A000040(n);
%F A268386 a(n^2) = a(n) XOR (2 * a(n)) = A048720(a(n), 3);
%F A268386 a(A059897(n, k)) = a(n) XOR a(k).
%F A268386 (End)
%t A268386 f[n_] := Which[0 <= # <= 1, #, EvenQ@ #, BitXor[2 #, #] &[f[#/2]], True, BitXor[#, 2 # + 1] &[f[(# - 1)/2]]] &@ Abs@ n; {0}~Join~Table[f[BitXor @@ Map[Last, FactorInteger@ n]], {n, 2, 120}] (* _Michael De Vlieger_, Feb 12 2016, after _Robert G. Wilson v_ at A048724 and A065621 *)
%o A268386 (Scheme) (define (A268386 n) (A193231 (A268387 n)))
%o A268386 (PARI)
%o A268386 a268387(n) = {my(f = factor(n), b = 0); for (k=1, #f~, b = bitxor(b, f[k, 2]); ); b; }
%o A268386 a193231(n) = {my(x='x); subst(lift(Mod(1, 2)*subst(Pol(binary(n), x), x, 1+x)), x, 2)};
%o A268386 a(n) = a193231(a268387(n)); \\ _Michel Marcus_, May 09 2020
%Y A268386 A003987, A048720, A059897, A193231, A268385, A268387 are used in definitions of this sequence.
%Y A268386 Cf. A000028 (indices of odd numbers), A000379 (indices of even numbers), A268390 (indices of zeros).
%K A268386 nonn
%O A268386 1,4
%A A268386 _Antti Karttunen_, Feb 10 2016