login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A086099 a(n) = OR(k AND (n-k): 0<=k<=n), AND and OR bitwise. 6
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, 15, 14, 15, 0, 31, 30, 31, 28, 31, 30, 31, 24, 31, 30, 31, 28, 31, 30, 31, 16, 31, 30, 31, 28, 31, 30, 31, 24, 31, 30, 31, 28, 31, 30, 31, 0, 63, 62, 63, 60, 63, 62, 63, 56, 63, 62 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

a(2*n) = A003817(n);

a(2^n - 1) = 0, a(3*2^n - 1) = 2^n;

A086100(n) = A007088(a(n)).

LINKS

R. Zumkeller, Table of n, a(n) for n = 0..10000

Eric Weisstein's World of Mathematics, AND

Eric Weisstein's World of Mathematics, OR

R. Zumkeller, Logical Convolutions

FORMULA

a(2*n) = 2*2^floor(log2(n)) - 1, a(2*n+1) = 2*a(n).

EXAMPLE

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.

MATHEMATICA

a[n_] := BitOr @@ Table[BitAnd[k, n - k], {k, 0, n}]; Table[a[n], {n, 0, 73}] (* Jean-Fran├žois Alcover, Jun 19 2012 *)

PROG

(Haskell)

import Data.Bits ((.&.), (.|.))

a086099 n = foldl1 (.|.) $ zipWith (.&.) [0..] $ reverse [0..n] :: Integer

-- Reinhard Zumkeller, Jun 04 2012

CROSSREFS

Cf. A003817, A062383.

Cf. A003817, A000004, A142149, A142150, A142151, A001477.

Sequence in context: A268932 A089306 A244996 * A048967 A324182 A166592

Adjacent sequences:  A086096 A086097 A086098 * A086100 A086101 A086102

KEYWORD

nonn,nice,hear,look

AUTHOR

Reinhard Zumkeller, Jul 09 2003

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 20 07:27 EDT 2019. Contains 321345 sequences. (Running on oeis4.)