login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Triangle read by rows: T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) XOR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and XOR is bitwise-XOR (A003987).
4

%I #14 Apr 17 2017 09:03:11

%S 1,1,1,1,0,1,1,3,3,1,1,2,0,2,1,1,5,2,2,5,1,1,4,15,0,15,4,1,1,7,9,27,

%T 27,9,7,1,1,6,18,54,0,54,18,6,1,1,9,20,36,126,126,36,20,9,1,1,8,45,

%U 112,42,0,42,112,45,8,1,1,11,39,85,170,46,46,170,85,39,11,1,1,10,60,146,495,132,0,132,495,146,60,10,1

%N Triangle read by rows: T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) XOR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and XOR is bitwise-XOR (A003987).

%H Antti Karttunen, <a href="/A285117/b285117.txt">Table of n, a(n) for n = 0..10584; the rows 0 - 144 of triangle</a>

%H <a href="/index/Pas#Pascal">Index entries for triangles and arrays related to Pascal's triangle</a>

%F T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) XOR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and XOR is bitwise-XOR (A003987).

%F T(n,k) = A285116(n,k) - A285118(n,k).

%F C(n,k) = T(n,k) + 2*A285118(n,k). [Where C(n,k) = A007318.]

%e Rows 0 - 12 of the triangle:

%e 1,

%e 1, 1,

%e 1, 0, 1,

%e 1, 3, 3, 1,

%e 1, 2, 0, 2, 1,

%e 1, 5, 2, 2, 5, 1,

%e 1, 4, 15, 0, 15, 4, 1,

%e 1, 7, 9, 27, 27, 9, 7, 1,

%e 1, 6, 18, 54, 0, 54, 18, 6, 1,

%e 1, 9, 20, 36, 126, 126, 36, 20, 9, 1,

%e 1, 8, 45, 112, 42, 0, 42, 112, 45, 8, 1,

%e 1, 11, 39, 85, 170, 46, 46, 170, 85, 39, 11, 1,

%e 1, 10, 60, 146, 495, 132, 0, 132, 495, 146, 60, 10, 1

%t T[n_, k_]:= If[n==0 || n==k, 1, BitXor[Binomial[n - 1, k - 1], Binomial[n - 1, k]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, Apr 16 2017 *)

%o (Scheme)

%o (define (A285117 n) (A285117tr (A003056 n) (A002262 n)))

%o (define (A285117tr n k) (cond ((zero? k) 1) ((= k n) 1) (else (A003987tr (A007318tr (- n 1) (- k 1)) (A007318tr (- n 1) k))))) ;; Where A003987bi implements bitwise-XOR (A003987) and A007318tr gives the binomial coefficients (A007318).

%o (PARI) T(n, k) = if (n==0 || n==k, 1, bitxor(binomial(n - 1, k - 1), binomial(n - 1, k)));

%o for(n=0, 12, for(k=0, n, print1(T(n, k),", ");); print();) \\ _Indranil Ghosh_, Apr 16 2017

%Y Cf. A003987, A007318, A285116, A285118.

%Y Cf. A285114 (row sums).

%K nonn,tabl

%O 0,8

%A _Antti Karttunen_, Apr 16 2017