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.

A142149 a(n) = XOR{k OR (n-k): 0<=k<=n}.

This page as a plain text file.
%I A142149 #19 Jul 01 2022 21:41:32
%S A142149 0,1,3,3,6,5,5,7,12,9,15,11,10,13,9,15,24,17,27,19,30,21,29,23,20,25,
%T A142149 23,27,18,29,17,31,48,33,51,35,54,37,53,39,60,41,63,43,58,45,57,47,40,
%U A142149 49,43,51,46,53,45,55,36,57,39,59,34,61,33,63,96,65,99,67,102,69,101,71
%N A142149 a(n) = XOR{k OR (n-k): 0<=k<=n}.
%C A142149 a(n) = XOR{k AND (n-k): 0<=k<=n}.
%H A142149 Reinhard Zumkeller, <a href="/A142149/b142149.txt">Table of n, a(n) for n = 0..10000</a>
%H A142149 Reinhard Zumkeller, <a href="/A142149/a142149.txt">Logical Convolutions</a>
%F A142149 a(2*n) = A048724(n) and a(2*n+1) = A005408(n).
%o A142149 (Haskell)
%o A142149 import Data.Bits (xor, (.|.))
%o A142149 a142149 :: Integer -> Integer
%o A142149 a142149 = foldl xor 0 . zipWith (.|.) [0..] . reverse . enumFromTo 1
%o A142149 -- _Reinhard Zumkeller_, Mar 31 2015
%o A142149 (Python)
%o A142149 def A142149(n): return n if n&1 else (n^ n>>1) # _Chai Wah Wu_, Jun 29 2022
%o A142149 (PARI) a(n)=if(n%2, n, bitxor(n, n/2)) \\ _Charles R Greathouse IV_, Jul 01 2022
%Y A142149 Cf. A003817, A000004, A086099, A142150, A142151, A001477.
%K A142149 nonn,hear,look,easy
%O A142149 0,3
%A A142149 _Reinhard Zumkeller_, Jul 15 2008