Starting on January 1, 2008 it became mandatory for all Brazilian public companies and private companies with net worth greater than two million reais (about one million dollars as of this writing) to publish a cash flow statement (CFS) as part of their financial statements, making this statement another important source of information for investors. This article proposes an algebraic generalization for the CFS. Working papers can help fill in a gap in teaching about cash flow statements and produce an indirect method and a direct method, side by side with their equivalence highlighted, in a single matrix by means of algebraic algorithms. This study is normative in nature and stresses the transversal relationship between accounting and mathematics, showing that accounting reports and their structures can be seen as matrices and be subjected to algebraic deductions about the events recorded by double entries. As a result, we demonstrate a mathematical algorithm with matrices and submatrices and a script in the format of working papers, compatible with the normative orientations of the Federal Accounting Council (CFS) and Brazilian legislation, permitting formulation of clear, reliable and effective cash flow statements.