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.
%I A099961 #24 Aug 03 2021 19:05:00 %S A099961 1,1,1,1,1,2,2,3,3,5,5,5,10,13,13,23,28,28,51,64,64,64,128,179,207, %T A099961 207,386,514,578,578,1092,1478,1685,1685,1685,3370,4848,5940,6518, %U A099961 6518,12458,17306,20676,22361,22361,43037,60343,72801,79319,79319,79319 %N A099961 Triangle read by rows: Each row is constructed by forming the partial sums of the previous row, reading from the right and at every third row repeating the final term. %C A099961 ... %H A099961 Reinhard Zumkeller, <a href="/A099961/b099961.txt">Rows n=0..120 of triangle, flattened</a> %e A099961 Triangle begins %e A099961 1; %e A099961 1, %e A099961 1, 1; %e A099961 1, 2, %e A099961 2, 3, %e A099961 3, 5, 5; %e A099961 5, 10, 13, %e A099961 13, 23, 28, %e A099961 28, 51, 64, 64; %p A099961 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 19 do if n mod 3 = 0 or n mod 3 = 1 then R[n]:=ps(rev(R[n-1])) else R[n]:=pss(rev(R[n-1])) fi od: for n from 0 to 19 do evalm(R[n]) od; # program yields the successive rows # _Emeric Deutsch_, Nov 16 2004 %t A099961 r[0] = {1}; r[n_] := r[n] = Join[ a = Accumulate[ Reverse[r[n-1]]], If[Mod[n, 3] == 2, {Last[a]}, {}]]; Flatten[ Table[r[n], {n, 0, 15}]](* _Jean-François Alcover_, Mar 13 2012 *) %o A099961 (Haskell) %o A099961 a099961 n k = a099961_tabl !! n !! k %o A099961 a099961_row n = a099961_tabl !! n %o A099961 a099961_tabl = map snd $ iterate f (0,[1]) where %o A099961 f (s,xs) = (s+1, if s `mod` 3 == 1 then zs ++ [last zs] else zs) %o A099961 where zs = scanl1 (+) (reverse xs) %o A099961 -- _Reinhard Zumkeller_, Dec 28 2011 %Y A099961 First column (and row sums) gives A099962. Cf. A099963, A099967. %Y A099961 If an extra term is added to /every/ row we get A008282. Cf. A099959. %K A099961 nonn,tabf,nice,easy %O A099961 0,6 %A A099961 _N. J. A. Sloane_, Nov 13 2004 %E A099961 More terms from _Emeric Deutsch_, Nov 16 2004