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.

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

This page as a plain text file.
%I A142151 #25 Jun 30 2022 18:00:55
%S A142151 0,1,2,3,6,5,6,7,14,13,14,11,14,13,14,15,30,29,30,27,30,29,30,23,30,
%T A142151 29,30,27,30,29,30,31,62,61,62,59,62,61,62,55,62,61,62,59,62,61,62,47,
%U A142151 62,61,62,59,62,61,62,55,62,61,62,59,62,61,62,63,126,125,126,123,126,125
%N A142151 a(n) = OR{k XOR (n-k): 0<=k<=n}.
%H A142151 Reinhard Zumkeller, <a href="/A142151/b142151.txt">Table of n, a(n) for n = 0..10000</a>
%H A142151 Reinhard Zumkeller, <a href="/A142149/a142149.txt">Logical Convolutions</a>
%F A142151 a(2*n) = 2*(A062383(n)-1);
%F A142151 A023416(a(n)) <= 1.
%p A142151 A142151 := n -> n + Bits:-Nor(n, n+1):
%p A142151 seq(A142151(n), n=0..69); # _Peter Luschny_, Sep 26 2019
%o A142151 (Haskell)
%o A142151 import Data.Bits (xor, (.|.))
%o A142151 a142151 :: Integer -> Integer
%o A142151 a142151 = foldl (.|.) 0 . zipWith xor [0..] . reverse . enumFromTo 1
%o A142151 -- _Reinhard Zumkeller_, Mar 31 2015
%o A142151 (Julia)
%o A142151 using IntegerSequences
%o A142151 A142151List(len) = [Bits("CIMP", n, n+1) for n in 0:len]
%o A142151 println(A142151List(69))  # _Peter Luschny_, Sep 25 2021
%o A142151 (Python)
%o A142151 from functools import reduce
%o A142151 from operator import or_
%o A142151 def A142151(n): return 0 if n == 0 else reduce(or_,(k^n-k for k in range(n+1))) if n % 2 else (1 << n.bit_length()-1)-1 <<1 # _Chai Wah Wu_, Jun 30 2022
%Y A142151 Cf. A003817, A000004, A142149, A086099, A142150, A001477, A089633.
%K A142151 nonn,hear,look
%O A142151 0,3
%A A142151 _Reinhard Zumkeller_, Jul 15 2008