login
A080098
Triangle T(n,k) = n OR k, 0 <= k <= n, bitwise logical OR, read by rows.
11
0, 1, 1, 2, 3, 2, 3, 3, 3, 3, 4, 5, 6, 7, 4, 5, 5, 7, 7, 5, 5, 6, 7, 6, 7, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 9, 11, 11, 13, 13, 15, 15, 9, 9, 10, 11, 10, 11, 14, 15, 14, 15, 10, 11, 10, 11, 11, 11, 11, 15, 15, 15, 15, 11, 11, 11, 11, 12, 13, 14, 15, 12, 13, 14, 15, 12, 13, 14, 15, 12
OFFSET
0,4
LINKS
Eric Weisstein's World of Mathematics, OR.
EXAMPLE
Triangle begins:
0,
1, 1,
2, 3, 2,
3, 3, 3, 3,
4, 5, 6, 7, 4,
5, 5, 7, 7, 5, 5,
6, 7, 6, 7, 6, 7, 6,
7, 7, 7, 7, 7, 7, 7, 7,
8, 9, 10, 11, 12, 13, 14, 15, 8,
9, 9, 11, 11, 13, 13, 15, 15, 9, 9,
10, 11, 10, 11, 14, 15, 14, 15, 10, 11, 10,
...
MATHEMATICA
T[n_, k_] := n ~BitOr~ k;
Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 01 2021 *)
PROG
(Haskell)
import Data.Bits ((.|.))
a080098 n k = n .|. k :: Int
a080098_row n = map (a080098 n) [0..n]
a080098_tabl = map a080098_row [0..]
-- Reinhard Zumkeller, Aug 03 2014, Jul 05 2012
(Python)
def T(n, k): return n | k
print([T(n, k) for n in range(13) for k in range(n+1)]) # Michael S. Branicky, Dec 01 2021
CROSSREFS
Cf. A001316 (number of integers k such that T(n, k) = n in n-th row).
Cf. A350093 (row sums), A003986 (array).
Other triangles: A080099 (AND), A051933 (XOR), A265705 (IMPL), A102037 (CNIMPL).
Sequence in context: A346153 A266119 A026263 * A083060 A346643 A272979
KEYWORD
nonn,easy,tabl,look
AUTHOR
Reinhard Zumkeller, Jan 28 2003
STATUS
approved