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.

Showing 1-3 of 3 results.

A285114 Row sums of A285117: a(n) = 2 + Sum_{k=1..(n-1)} C(n-1,k-1) XOR C(n-1,k), a(0) = 1, a(1) = 2.

Original entry on oeis.org

1, 2, 2, 8, 6, 16, 40, 88, 158, 384, 416, 704, 1688, 2896, 8680, 14128, 28942, 65152, 111200, 231504, 438736, 942480, 1772016, 4320464, 7173432, 18279648, 29516976, 66594368, 125302232, 258582272, 502725168, 1009023808, 2156547822, 3961342464, 8844419136, 17224261808, 34931449264, 71168739072, 138318974000, 307489703840
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[n<2,  n + 1, 2 + Sum[BitXor[Binomial[n - 1,k - 1], Binomial[n - 1, k]], {k, n - 1}]]; Table[a[n], {n, 0, 100}] (* Indranil Ghosh, Apr 16 2017 *)
  • PARI
    A285114(n) = if(n<2,n+1,2+sum(k=1,(n-1),bitxor(binomial(n-1,k-1),binomial(n-1,k))));
    
  • Scheme
    (define (A285114 n) (add A285117 (A000217 n) (+ -1 (A000217 (+ 1 n)))))
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (+ 1 i) (+ res (intfun i)))))))

Formula

a(0) = 1, a(1) = 2, for n > 1, a(n) = 2 + Sum_{k=1..(n-1)} C(n-1,k-1) XOR C(n-1,k), where C(n,k) is a binomial coefficient and XOR is bitwise-XOR (A003987).
a(n) = A285113(n) - A285115(n).
a(n) = A000079(n) - 2*A285115(n).

A285116 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) OR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and OR is bitwise-OR (A003986).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 3, 3, 3, 1, 1, 5, 6, 6, 5, 1, 1, 5, 15, 10, 15, 5, 1, 1, 7, 15, 31, 31, 15, 7, 1, 1, 7, 23, 55, 35, 55, 23, 7, 1, 1, 9, 28, 60, 126, 126, 60, 28, 9, 1, 1, 9, 45, 116, 126, 126, 126, 116, 45, 9, 1, 1, 11, 47, 125, 250, 254, 254, 250, 125, 47, 11, 1, 1, 11, 63, 183, 495, 462, 462, 462, 495, 183, 63, 11, 1
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Examples

			Rows 0 - 12 of the triangle:
  1,
  1, 1,
  1, 1, 1,
  1, 3, 3, 1,
  1, 3, 3, 3, 1,
  1, 5, 6, 6, 5, 1,
  1, 5, 15, 10, 15, 5, 1,
  1, 7, 15, 31, 31, 15, 7, 1,
  1, 7, 23, 55, 35, 55, 23, 7, 1,
  1, 9, 28, 60, 126, 126, 60, 28, 9, 1,
  1, 9, 45, 116, 126, 126, 126, 116, 45, 9, 1,
  1, 11, 47, 125, 250, 254, 254, 250, 125, 47, 11, 1,
  1, 11, 63, 183, 495, 462, 462, 462, 495, 183, 63, 11, 1
		

Crossrefs

Cf. A285113 (row sums).

Programs

  • Mathematica
    T[n_, k_]:= If[n==0 || n==k, 1, BitOr[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 *)
  • PARI
    T(n, k) = if (n==0 || n==k, 1, bitor(binomial(n - 1, k - 1), binomial(n - 1, k)));
    for(n=0, 12, for(k=0, n, print1(T(n, k),", ");); print();) \\ Indranil Ghosh, Apr 16 2017
  • Scheme
    (define (A285116 n) (A285116tr (A003056 n) (A002262 n)))
    (define (A285116tr n k) (cond ((zero? k) 1) ((= k n) 1) (else (A003986tr (A007318tr (- n 1) (- k 1)) (A007318tr (- n 1) k))))) ;; Where A003986bi implements bitwise-OR (A003986) and A007318tr gives the binomial coefficients (A007318).
    

Formula

T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) OR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and OR is bitwise-OR (A003986).
T(n,k) = A285117(n,k) + A285118(n,k).
C(n,k) = T(n,k) + A285118(n,k). [Where C(n,k) = A007318.]

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

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 4, 4, 0, 0, 0, 1, 0, 10, 0, 1, 0, 0, 0, 6, 4, 4, 6, 0, 0, 0, 1, 5, 1, 35, 1, 5, 1, 0, 0, 0, 8, 24, 0, 0, 24, 8, 0, 0, 0, 1, 0, 4, 84, 126, 84, 4, 0, 1, 0, 0, 0, 8, 40, 80, 208, 208, 80, 40, 8, 0, 0, 0, 1, 3, 37, 0, 330, 462, 330, 0, 37, 3, 1, 0, 0, 0, 0, 64, 204, 264, 792, 792, 264, 204, 64, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Examples

			Rows 0-13 of array:
  0,
  0, 0,
  0, 1, 0,
  0, 0, 0, 0,
  0, 1, 3, 1, 0,
  0, 0, 4, 4, 0, 0,
  0, 1, 0, 10, 0, 1, 0,
  0, 0, 6, 4, 4, 6, 0, 0,
  0, 1, 5, 1, 35, 1, 5, 1, 0,
  0, 0, 8, 24, 0, 0, 24, 8, 0, 0,
  0, 1, 0, 4, 84, 126, 84, 4, 0, 1, 0,
  0, 0, 8, 40, 80, 208, 208, 80, 40, 8, 0, 0,
  0, 1, 3, 37, 0, 330, 462, 330, 0, 37, 3, 1, 0,
  0, 0, 0, 64, 204, 264, 792, 792, 264, 204, 64, 0, 0, 0
		

Crossrefs

Cf. A285115 (row sums).

Programs

  • Mathematica
    T[n_, k_]:= If[n==0 || n==k, 0, BitAnd[Binomial[n - 1, k - 1], Binomial[n - 1, k]]]; Table[T[n, k], {n, 0, 13}, {k, 0, n}] // Flatten (* Indranil Ghosh, Apr 16 2017 *)
  • PARI
    T(n, k) = if (n==0 || n==k, 0, bitand(binomial(n - 1, k - 1), binomial(n - 1, k)));
    for(n=0, 13, for(k=0, n, print1(T(n, k),", ");); print();) \\ Indranil Ghosh, Apr 16 2017
  • Scheme
    (define (A285118 n) (A285118tr (A003056 n) (A002262 n)))
    (define (A285118tr n k) (cond ((zero? k) 0) ((= k n) 0) (else (A004198bi (A007318tr (- n 1) (- k 1)) (A007318tr (- n 1) k))))) ;; Where A004198bi implements bitwise-AND (A004198) and A007318tr gives the binomial coefficients (A007318).
    

Formula

T(0,n) = T(n,n) = 0; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) AND C(n-1,k), where C(n,k) is binomial coefficient (A007318) & AND is bitwise-AND (A004198).
T(n,k) = A285116(n,k) - A285117(n,k).
A007318(n,k) = C(n,k) = A285116(n,k) + T(n,k) = A285117(n,k) + 2*T(n,k).
Showing 1-3 of 3 results.