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.

A099959 Triangle read by rows: Each row is constructed by forming the partial sums of the previous row, reading from the right and at every other row repeating the final term.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 6, 8, 8, 14, 17, 17, 17, 34, 48, 56, 56, 104, 138, 155, 155, 155, 310, 448, 552, 608, 608, 1160, 1608, 1918, 2073, 2073, 2073, 4146, 6064, 7672, 8832, 9440, 9440, 18272, 25944, 32008, 36154, 38227, 38227, 38227, 76454, 112608
Offset: 0

Views

Author

N. J. A. Sloane, Nov 13 2004

Keywords

Comments

...

Examples

			Triangle begins
   1;
   1,
   1,   1;
   1,   2,
   2,   3,   3;
   3,   6,   8,
   8,  14,  17,  17;
  17,  34,  48,  56,
  56, 104, 138, 155, 155;
		

Crossrefs

First column (and row sums) gives A099960.
If an extra term is added to /every/ row we get A008282. Cf. A099961.

Programs

  • Haskell
    a099959 n k = a099959_tabl !! n !! k
    a099959_row n = a099959_tabl !! n
    a099959_tabl = map snd $ iterate f (False,[1]) where
       f (s,xs) = (not s, if s then zs ++ [last zs] else zs)
         where zs = scanl1 (+) (reverse xs)
    -- Reinhard Zumkeller, Dec 28 2011
  • Maple
    with(linalg):rev:=proc(a) local n, p; n:=vectdim(a): p:=i->a[n+1-i]: vector(n,p) end: ps:=proc(a) local n, q; n:=vectdim(a): q:=i->sum(a[j],j=1..i): vector(n,q) end: pss:=proc(a) local n, q; n:=vectdim(a): q:=proc(i) if i<=n then sum(a[j],j=1..i) else sum(a[j],j=1..n) fi end: vector(n+1,q) end: R[0]:=vector(1,1): for n from 1 to 18 do if n mod 2 = 1 then R[n]:=ps(rev(R[n-1])) else R[n]:=pss(rev(R[n-1])) fi od: for n from 0 to 18 do evalm(R[n]) od; # program yields the successive rows # Emeric Deutsch, Nov 16 2004
  • Mathematica
    row[0] = row[1] = {1}; row[n_?OddQ] := Accumulate[ Reverse[ row[n-1] ] ]; row[n_?EvenQ] := (r = Accumulate[ Reverse[ row[n-1] ] ]; AppendTo[r, Last[r] ]); Flatten[ Table[ row[n], {n, 0, 13}]] (* Jean-François Alcover, Dec 16 2011 *)

Extensions

More terms from Emeric Deutsch, Nov 16 2004

A127969 Inverse of number triangle A127967.

Original entry on oeis.org

1, -1, 1, -1, 0, 1, 1, 0, -2, 1, 2, 0, -3, 0, 1, -3, 0, 5, 0, -3, 1, -8, 0, 13, 0, -6, 0, 1, 17, 0, -28, 0, 14, 0, -4, 1, 56, 0, -92, 0, 45, 0, -10, 0, 1, -155, 0, 255, 0, -126, 0, 30, 0, -5, 1, -608
Offset: 0

Views

Author

Paul Barry, Feb 09 2007

Keywords

Comments

First column is (-1)^C(n+1,2)*A099960(n), signed interleaved Genocchi numbers of the first and second kind. Row sums are (1,0,0,0,...).

Examples

			Triangle begins
1,
-1, 1,
-1, 0, 1,
1, 0, -2, 1,
2, 0, -3, 0, 1,
-3, 0, 5, 0, -3, 1,
-8, 0, 13, 0, -6, 0, 1,
17, 0, -28, 0, 14, 0, -4, 1,
56, 0, -92, 0, 45, 0, -10, 0, 1,
-155, 0, 255, 0, -126, 0, 30, 0, -5, 1,
-608, 0, 1000, 0, -493, 0, 115, 0, -15, 0, 1,
2073, 0, -3410, 0, 1683, 0, -396, 0, 55, 0, -6, 1,
9440, 0, -15528, 0, 7662, 0, -1799, 0, 245, 0, -21, 0, 1
		

A294281 Number of ascent sequences of length n with alternating ascents and descents (unaffected by level steps).

Original entry on oeis.org

1, 1, 2, 4, 9, 22, 59, 172, 547, 1886, 7047, 28360, 122675, 567210, 2796999, 14641044, 81191947, 475148678, 2929442263, 18965690560, 128754649699, 914056305794, 6777666961735, 52367331911180, 421188392986843, 3519168714308702, 30519733808467031
Offset: 0

Views

Author

Alois P. Heinz, Oct 26 2017

Keywords

Examples

			a(3) = 4: 000, 001, 010, 011.
a(4) = 9: 0000, 0001, 0010, 0011, 0100, 0101, 0102, 0110, 0111.
a(5) = 22: 00000, 00001, 00010, 00011, 00100, 00101, 00102, 00110, 00111, 01000, 01001, 01002, 01010, 01011, 01020, 01021, 01022, 01100, 01101, 01102, 01110, 01111.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t, u) option remember; `if`(n<1, 1, add(
           b(n-1, j, t+`if`(j>i, 1, 0), `if`(i=j, u, 1-u)),
           j=`if`(u=0, i..t+1, 0..i)))
        end:
    a:= n-> b(n-1, 0$3):
    seq(a(n), n=0..30);

Formula

a(n) = Sum_{j=0..n} binomial(n-1,j) * A099960(n-j).
Showing 1-3 of 3 results.