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.

A086099 a(n) = OR(k AND (n-k): 0<=k<=n), AND and OR bitwise.

This page as a plain text file.
%I A086099 #34 Feb 16 2025 08:32:50
%S A086099 0,0,1,0,3,2,3,0,7,6,7,4,7,6,7,0,15,14,15,12,15,14,15,8,15,14,15,12,
%T A086099 15,14,15,0,31,30,31,28,31,30,31,24,31,30,31,28,31,30,31,16,31,30,31,
%U A086099 28,31,30,31,24,31,30,31,28,31,30,31,0,63,62,63,60,63,62,63,56,63,62
%N A086099 a(n) = OR(k AND (n-k): 0<=k<=n), AND and OR bitwise.
%C A086099 a(2^n - 1) = 0, a(3*2^n - 1) = 2^n;
%C A086099 A086100(n) = A007088(a(n)).
%H A086099 Reinhard Zumkeller, <a href="/A086099/b086099.txt">Table of n, a(n) for n = 0..10000</a>
%H A086099 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AND.html">AND</a>
%H A086099 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/OR.html">OR</a>
%H A086099 Reinhard Zumkeller, <a href="/A142149/a142149.txt">Logical Convolutions</a>
%F A086099 a(2*n) = 2*2^floor(log_2(n)) - 1 = A003817(n).
%F A086099 a(2*n+1) = 2*a(n).
%F A086099 a(n) = A053644(n+1) - A006519(n+1). - _Ridouane Oudra_, Apr 09 2023
%e A086099 a(4) = (0 AND 4) OR (1 AND 3) OR (2 AND 2) OR (3 AND 1) OR (4 AND 0) -> (000 AND 100) OR (001 AND 011) OR (010 AND 010) OR (011 AND 001) OR (111 AND 000) = 000 OR 011 OR 010 OR 011 OR 000 = 011 -> a(4)=3.
%t A086099 a[n_] := BitOr @@ Table[BitAnd[k, n - k], {k, 0, n}]; Table[a[n], {n, 0, 73}] (* _Jean-François Alcover_, Jun 19 2012 *)
%o A086099 (Haskell)
%o A086099 import Data.Bits ((.&.), (.|.))
%o A086099 a086099 n = foldl1 (.|.) $ zipWith (.&.) [0..] $ reverse [0..n] :: Integer
%o A086099 -- _Reinhard Zumkeller_, Jun 04 2012
%o A086099 (PARI) a(n) = n++; 1<<logint(n,2) - 1<<valuation(n,2); \\ _Kevin Ryde_, Apr 11 2023
%Y A086099 Cf. A003817 (even bisection), A062383.
%Y A086099 Cf. A086100 (in binary), A007088.
%Y A086099 Cf. A053644, A006519.
%Y A086099 Cf. A000004, A142149, A142150, A142151, A001477.
%K A086099 nonn,nice,easy,hear,look
%O A086099 0,5
%A A086099 _Reinhard Zumkeller_, Jul 09 2003