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.

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.

This page as a plain text file.
%I A099959 #27 Sep 02 2023 18:20:00
%S A099959 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,
%T A099959 155,310,448,552,608,608,1160,1608,1918,2073,2073,2073,4146,6064,7672,
%U A099959 8832,9440,9440,18272,25944,32008,36154,38227,38227,38227,76454,112608
%N 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.
%C A099959 ...
%H A099959 Reinhard Zumkeller, <a href="/A099959/b099959.txt">Rows n = 0..119 of triangle, flattened</a>
%e A099959 Triangle begins
%e A099959    1;
%e A099959    1,
%e A099959    1,   1;
%e A099959    1,   2,
%e A099959    2,   3,   3;
%e A099959    3,   6,   8,
%e A099959    8,  14,  17,  17;
%e A099959   17,  34,  48,  56,
%e A099959   56, 104, 138, 155, 155;
%p A099959 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
%t A099959 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 *)
%o A099959 (Haskell)
%o A099959 a099959 n k = a099959_tabl !! n !! k
%o A099959 a099959_row n = a099959_tabl !! n
%o A099959 a099959_tabl = map snd $ iterate f (False,[1]) where
%o A099959    f (s,xs) = (not s, if s then zs ++ [last zs] else zs)
%o A099959      where zs = scanl1 (+) (reverse xs)
%o A099959 -- _Reinhard Zumkeller_, Dec 28 2011
%Y A099959 First column (and row sums) gives A099960.
%Y A099959 If an extra term is added to /every/ row we get A008282. Cf. A099961.
%K A099959 nonn,tabf,nice,easy
%O A099959 0,6
%A A099959 _N. J. A. Sloane_, Nov 13 2004
%E A099959 More terms from _Emeric Deutsch_, Nov 16 2004