login
Triangle read by rows: T(n,k) = k IMPL n, 0 <= k <= n, bitwise logical IMPL.
14

%I #49 Dec 17 2021 01:40:48

%S 0,1,1,3,2,3,3,3,3,3,7,6,5,4,7,7,7,5,5,7,7,7,6,7,6,7,6,7,7,7,7,7,7,7,

%T 7,7,15,14,13,12,11,10,9,8,15,15,15,13,13,11,11,9,9,15,15,15,14,15,14,

%U 11,10,11,10,15,14,15,15,15,15,15,11,11,11,11,15

%N Triangle read by rows: T(n,k) = k IMPL n, 0 <= k <= n, bitwise logical IMPL.

%H Reinhard Zumkeller, <a href="/A265705/b265705.txt">Rows n = 0..255 of triangle, flattened</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Implies.html">Implies</a>

%F T(n,0) = T(n,n) = A003817(n).

%F T(2*n,n) = A265716(n).

%F Let m = A089633(n): T(m,k) = T(m,m-k), k = 0..m.

%F Let m = A158582(n): T(m,k) != T(m,m-k) for at least one k <= n.

%F Let m = A247648(n): T(2*m,m) = 2*m.

%F For n > 0: A029578(n+2) = number of odd terms in row n; no even terms in odd-indexed rows.

%F A265885(n) = T(prime(n),n).

%F A053644(n) = smallest k such that row k contains n.

%e . 10 | 1010 12 | 1100

%e . 4 | 100 6 | 110

%e . ----------+----- ----------+-----

%e . 4 IMPL 10 | 1011 -> T(10,4)=11 6 IMPL 12 | 1101 -> T(12,6)=13

%e .

%e First 16 rows of the triangle, where non-symmetrical rows are marked, see comment concerning A158582 and A089633:

%e . 0: 0

%e . 1: 1 1

%e . 2: 3 2 3

%e . 3: 3 3 3 3

%e . 4: 7 6 5 4 7 X

%e . 5: 7 7 5 5 7 7

%e . 6: 7 6 7 6 7 6 7

%e . 7: 7 7 7 7 7 7 7 7

%e . 8: 15 14 13 12 11 10 9 8 15 X

%e . 9: 15 15 13 13 11 11 9 9 15 15 X

%e . 10: 15 14 15 14 11 10 11 10 15 14 15 X

%e . 11: 15 15 15 15 11 11 11 11 15 15 15 15

%e . 12: 15 14 13 12 15 14 13 12 15 14 13 12 15 X

%e . 13: 15 15 13 13 15 15 13 13 15 15 13 13 15 15

%e . 14: 15 14 15 14 15 14 15 14 15 14 15 14 15 14 15

%e . 15: 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 .

%p A265705 := (n, k) -> Bits:-Implies(k, n):

%p seq(seq(A265705(n, k), k=0..n), n=0..11); # _Peter Luschny_, Sep 23 2019

%t T[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[n, 2]]-1-k, n]];

%t Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Sep 25 2021, after _David A. Corneth_'s PARI code *)

%o (Haskell)

%o a265705_tabl = map a265705_row [0..]

%o a265705_row n = map (a265705 n) [0..n]

%o a265705 n k = k `bimpl` n where

%o bimpl 0 0 = 0

%o bimpl p q = 2 * bimpl p' q' + if u <= v then 1 else 0

%o where (p', u) = divMod p 2; (q', v) = divMod q 2

%o (PARI) T(n, k) = if(n==0,return(0)); bitor((2<<logint(n,2))-1-k,n) \\ _David A. Corneth_, Sep 24 2021

%o (Julia)

%o using IntegerSequences

%o for n in 0:15 println(n == 0 ? [0] : [Bits("IMP", k, n) for k in 0:n]) end # _Peter Luschny_, Sep 25 2021

%Y Cf. A003817, A007088, A029578, A089633, A158582, A247648, A265716 (central terms), A265736 (row sums).

%Y Cf. A053644, A265885, A327490.

%Y Other triangles: A080099 (AND), A080098 (OR), A051933 (XOR), A102037 (CNIMPL).

%K nonn,easy,tabl,look

%O 0,4

%A _Reinhard Zumkeller_, Dec 15 2015