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.

A080099 Triangle T(n,k) = n AND k, 0<=k<=n, bitwise logical AND, read by rows.

Original entry on oeis.org

0, 0, 1, 0, 0, 2, 0, 1, 2, 3, 0, 0, 0, 0, 4, 0, 1, 0, 1, 4, 5, 0, 0, 2, 2, 4, 4, 6, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 1, 0, 1, 0, 1, 0, 1, 8, 9, 0, 0, 2, 2, 0, 0, 2, 2, 8, 8, 10, 0, 1, 2, 3, 0, 1, 2, 3, 8, 9, 10, 11, 0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 12, 0, 1, 0, 1, 4, 5, 4, 5, 8, 9, 8, 9
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Comments

A080100(n) = number of numbers k such that n AND k = 0 in n-th row of the triangular array.

Examples

			Triangle starts:
0
0 1
0 0 2
0 1 2 3
0 0 0 0 4
0 1 0 1 4 5
0 0 2 2 4 4 6
0 1 2 3 4 5 6 7
...
		

Crossrefs

Cf. A080100, A222423 (row sums), A004198 (array).
Other triangles: A080098 (OR), A051933 (XOR), A265705 (IMPL), A102037 (CNIMPL).

Programs

  • Haskell
    import Data.Bits ((.&.))
    a080099 n k = n .&. k :: Int
    a080099_row n = map (a080099 n) [0..n]
    a080099_tabl = map a080099_row [0..]
    -- Reinhard Zumkeller, Aug 03 2014, Jul 05 2012
    
  • Mathematica
    Column[Table[BitAnd[n, k], {n, 0, 15}, {k, 0, n}], Center] (* Alonso del Arte, Jun 19 2012 *)
  • PARI
    T(n,k)=bitand(n,k) \\ Charles R Greathouse IV, Jan 26 2013
    
  • Python
    def T(n, k): return n & k
    print([T(n, k) for n in range(14) for k in range(n+1)]) # Michael S. Branicky, Dec 16 2021