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.

A193554 Triangle read by rows: first column: top entry is 1, then powers of 2; rest of triangle is Pascal's triangle A007318.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 4, 1, 2, 1, 8, 1, 3, 3, 1, 16, 1, 4, 6, 4, 1, 32, 1, 5, 10, 10, 5, 1, 64, 1, 6, 15, 20, 15, 6, 1, 128, 1, 7, 21, 35, 35, 21, 7, 1, 256, 1, 8, 28, 56, 70, 56, 28, 8, 1, 512, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 1024, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 2048, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jul 30 2011

Keywords

Comments

The original definition of A135233 made no sense. In fact A135233 is the binomial transform of the present sequence.

Examples

			Triangle begins:
   1;
   1, 1;
   2, 1, 1;
   4, 1, 2,  1;
   8, 1, 3,  3,  1;
  16, 1, 4,  6,  4,  1;
  32, 1, 5, 10, 10,  5, 1;
  64, 1, 6, 15, 20, 15, 6, 1;
...
		

Crossrefs

Cf. A000079 (row sums)

Programs

  • Magma
    function T(n,k)
      if k eq n then return 1;
      elif k eq 0 then return 2^(n-1);
      else return Binomial(n-1, k-1);
      end if; return T; end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 20 2019
    
  • Maple
    T:= proc(n, k) option remember;
          if k=n then 1
        elif k=0 then 2^(n-1)
        else binomial(n-1,k-1)
          fi; end:
    seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Nov 20 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, 2^(n-1), Binomial[n-1, k-1]]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 20 2019 *)
  • PARI
    T(n,k) = if(k==n, 1, if(k==0, 2^(n-1), binomial(n-1, k-1) )); \\ G. C. Greubel, Nov 20 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==n): return 1
        elif (k==0): return 2^(n-1)
        else: return binomial(n-1, k-1)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 20 2019