\documentclass[fullpage,10pt, openany]{book}
\usepackage{amsmath, multicol,  moreverb,etex}
%\usepackage{etex}

\usepackage{fancyhdr} %%%%for page headers and footers
\usepackage[Lenny]{fncychap}
%%%%%                   Postscript drawing packages
\usepackage[usenames,dvipsnames]{pstcol}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pst-poly}
\usepackage{pstricks-add}
\usepackage{mathptmx}% instead of package times
\usepackage[scaled=0.92]{helvet} % or [scaled=0.92], if you like
\usepackage{courier}

%%%%Note: Eventually I might convert all the pstricks drawings into metafont. Who knows.

\usepackage{hangcaption}
\usepackage[amsmath,thmmarks,standard,thref]{ntheorem}
\usepackage[colorlinks=true,linkcolor=red, pdftitle={difference calculus generating functions}, pdfauthor={david santos}, bookmarksopen, dvips]{hyperref}
\usepackage{pdflscape}
\usepackage{thumbpdf}
\usepackage[dvips]{graphicx}
\usepackage[usenames,dvipsnames]{color}
\usepackage{answers}
\Newassociation{answer6}{Answer}{discans}
%%Note: I had to comment-out marvosym.sty on the line \def\Rightarrow{{\mvchr58}}
%%because it wasn't giving the standard \implies command. Anyone knowing a better way
%%of dealing with this problem, please email me.

%%%%%                  FONTS

\usepackage{pifont, marvosym,amssymb,mathrsfs, manfnt, amsfonts, yhmath}


%%%%%FLOAT PLACEMENT
\renewcommand{\textfraction}{0.05}
\renewcommand{\topfraction}{0.95}
\renewcommand{\bottomfraction}{0.95}
\renewcommand{\floatpagefraction}{0.35}
\setcounter{totalnumber}{5}

%%%%%%%%%PRINTED AREA
\topmargin -.6in \textheight 9.4in \oddsidemargin -.3in
\evensidemargin -.3in \textwidth 7in


%%%%%                    THEOREM-LIKE ENVIRONMENTS
\newcommand{\proofsymbol}{\Pisymbol{pzd}{113}}

\theorempreskipamount .5cm \theorempostskipamount .5cm
\theoremstyle{change} \theoremheaderfont{\sffamily\bfseries}
\theorembodyfont{\normalfont} \newtheorem{thm}{Theorem}
 \newtheorem{cor}[thm]{Corollary}
\newtheorem{exa}[thm]{Example}
\newtheorem{df}[thm]{Definition}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{rul}[thm]{Rule}
\newtheorem{pro}[thm]{Problem}
\theoremstyle{nonumberplain}
\theoremheaderfont{\sffamily\bfseries} \theorembodyfont{\upshape}
\theoremsymbol{\proofsymbol}
\newtheorem{pf}{\textcolor{blue}{Proof}}
\theoremseparator{} \theoremstyle{nonumberplain}
\theoremheaderfont{\sffamily\bfseries}
\theoremindent1cm\theorembodyfont{\small\tt\it} \theoremsymbol{}
\newtheorem{rem}{\huge\textcolor{red}\Stopsign}





%%Note: I had to comment-out marvosym.sty on the line \def\Rightarrow{{\mvchr58}}
%%because it wasn't giving the standard \implies command. Anyone knowing a better way
%%of dealing with this problem, please email me.

%%%%%                Non-standard commands and symbols
\newcommand{\divides}{\;|\;}
\newcommand{\power}{\mathscr{P}}
\newcommand{\A}{\mathscr{A}}
\newcommand{\BBZ}{\mathbb{Z}}
\newcommand{\BBR}{\mathbb{R}}
\newcommand{\BBN}{\mathbb{N}}
\newcommand{\BBC}{\mathbb{C}}
\newcommand{\BBQ}{\mathbb{Q}}
\def\binom#1#2{{#1\choose#2}}
\def\arc#1{{\wideparen{#1}}}
\newcommand{\dis}{\displaystyle}
\def\fun#1#2#3#4#5{\everymath{\displaystyle}{{#1} : \vspace{1cm}
\begin{array}{ccc}{#4} & \rightarrow &
{#5}\\
{#2} &  \mapsto & {#3} \\
\end{array}}}
\def\sgn#1{{\mathrm{signum}}\left(#1\right)}
\newcommand{\comp}{\complement}
\def\dom#1{{\mathbf{Dom}}\left(#1\right)}
\def\target#1{{\mathbf{Target}}\left(#1\right)}
\def\card#1{\mathrm{card}\left(#1\right)}
\def\im#1{{\mathbf{Im}}\left(#1\right)}
\newcommand{\curlyF}{\mathcal{F}}
%%%%%%%%%%%%%%%%%INTERVALS
%%%%%%%% lo= left open, rc = right closed, etc.
\def\lcrc#1#2{\left[#1 \ ; #2 \right]}
\def\loro#1#2{ \left]#1 \ ; #2 \right[}
\def\lcro#1#2{\left[#1 \ ; #2 \right. \left[ \right.}
\def\lorc#1#2{\left. \right[#1 \ ; #2 \left.\right]}


%%%%Title Page

\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1pt\hfill \kern \z@}
\renewcommand{\maketitle}{\begin{titlepage}%
    \let\footnotesize\small
    \let\footnoterule\relax
    \parindent \z@
    \reset@font
    \null\vfil
    \begin{flushleft}
     \@title
    \end{flushleft}
    \par
    \hrule height 4pt
    \par
    \begin{flushright}
    \@author \par
    \end{flushright}
  \vskip 60\p@
  \vspace*{\stretch{2}}
    \vskip 60\p@
    \vspace*{\stretch{2}}
    \begin{center}
\Large\textsf{\today\quad REVISION}
    \end{center}
  \end{titlepage}%
  \setcounter{footnote}{0}%
}


\makeatother

\title{\textcolor{red}{\Large Difference Calculus and Generating Functions}}
\author{\textcolor{blue}{David A. SANTOS} \\
\href{mailto:dsantos@ccp.edu}{dsantos@ccp.edu}}
%%%%%%%




\makeatletter
\newcommand{\twocoltoc}{%
  \section*{\contentsname
      \@mkboth{%
        }{}}%
  \begin{multicols}{2}\columnseprule 1pt \columnsep 25pt\multicoltolerance=900\small
    \@starttoc{toc}%
  \end{multicols}}
\makeatother


\makeindex
%%%%%%                  And voilà the document !!!

\begin{document}
% Front matter may follow here
\begin{frontmatter}
 \maketitle
 \twocoltoc{}
 \end{frontmatter}
\chapter*{Preface}
\markboth{}{} \addcontentsline{toc}{chapter}{Preface}
\markright{Preface}

A work for my amusement only. Haven't gone over these in years, even
though I am making them public now.
\bigskip

\hfill \begin{tabular}{ll}David A. Santos \\
\href{mailto:dsantos@ccp.edu}{dsantos@ccp.edu}
\end{tabular}
\vfill Things to do:
\begin{itemize}
\item Weave functions into counting, {\it \`{a} la twelfold way\ldots }
\end{itemize}


\vfill


 \clearpage



\begin{quote}
    Copyright \copyright{}  2007  David Anthony SANTOS.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.2
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled ``GNU
    Free Documentation License''.
\end{quote}


\clearpage

\chapter*{GNU Free Documentation License}
{\tiny
 \begin{center}

       Version 1.2, November 2002


 Copyright \copyright{} 2000,2001,2002  Free Software Foundation, Inc.

 \bigskip

     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

 \bigskip

 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
\end{center}


\begin{center}
{\bf\large Preamble}
\end{center}

The purpose of this License is to make a manual, textbook, or other
functional and useful document ``free'' in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or
noncommercially. Secondarily, this License preserves for the author
and publisher a way to get credit for their work, while not being
considered responsible for modifications made by others.

This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a
free program should come with manuals providing the same freedoms
that the software does.  But this License is not limited to software
manuals; it can be used for any textual work, regardless of subject
matter or whether it is published as a printed book.  We recommend
this License principally for works whose purpose is instruction or
reference.


\begin{center}
{\Large\bf 1. APPLICABILITY AND DEFINITIONS\par} \phantomsection
\addcontentsline{toc}{section}{1. APPLICABILITY AND DEFINITIONS}
\end{center}

This License applies to any manual or other work, in any medium,
that contains a notice placed by the copyright holder saying it can
be distributed under the terms of this License.  Such a notice
grants a world-wide, royalty-free license, unlimited in duration, to
use that work under the conditions stated herein.  The
``\textbf{Document}'', below, refers to any such manual or work. Any
member of the public is a licensee, and is addressed as
``\textbf{you}''.  You accept the license if you copy, modify or
distribute the work in a way requiring permission under copyright
law.

A ``\textbf{Modified Version}'' of the Document means any work
containing the Document or a portion of it, either copied verbatim,
or with modifications and/or translated into another language.

A ``\textbf{Secondary Section}'' is a named appendix or a
front-matter section of the Document that deals exclusively with the
relationship of the publishers or authors of the Document to the
Document's overall subject (or to related matters) and contains
nothing that could fall directly within that overall subject. (Thus,
if the Document is in part a textbook of mathematics, a Secondary
Section may not explain any mathematics.)  The relationship could be
a matter of historical connection with the subject or with related
matters, or of legal, commercial, philosophical, ethical or
political position regarding them.

The ``\textbf{Invariant Sections}'' are certain Secondary Sections
whose titles are designated, as being those of Invariant Sections,
in the notice that says that the Document is released under this
License.  If a section does not fit the above definition of
Secondary then it is not allowed to be designated as Invariant.  The
Document may contain zero Invariant Sections.  If the Document does
not identify any Invariant Sections then there are none.

The ``\textbf{Cover Texts}'' are certain short passages of text that
are listed, as Front-Cover Texts or Back-Cover Texts, in the notice
that says that the Document is released under this License.  A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.

A ``\textbf{Transparent}'' copy of the Document means a
machine-readable copy, represented in a format whose specification
is available to the general public, that is suitable for revising
the document straightforwardly with generic text editors or (for
images composed of pixels) generic paint programs or (for drawings)
some widely available drawing editor, and that is suitable for input
to text formatters or for automatic translation to a variety of
formats suitable for input to text formatters.  A copy made in an
otherwise Transparent file format whose markup, or absence of
markup, has been arranged to thwart or discourage subsequent
modification by readers is not Transparent. An image format is not
Transparent if used for any substantial amount of text.  A copy that
is not ``Transparent'' is called ``\textbf{Opaque}''.

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming
simple HTML, PostScript or PDF designed for human modification.
Examples of transparent image formats include PNG, XCF and JPG.
Opaque formats include proprietary formats that can be read and
edited only by proprietary word processors, SGML or XML for which
the DTD and/or processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.

The ``\textbf{Title Page}'' means, for a printed book, the title
page itself, plus such following pages as are needed to hold,
legibly, the material this License requires to appear in the title
page.  For works in formats which do not have any title page as
such, ``Title Page'' means the text near the most prominent
appearance of the work's title, preceding the beginning of the body
of the text.

A section ``\textbf{Entitled XYZ}'' means a named subunit of the
Document whose title either is precisely XYZ or contains XYZ in
parentheses following text that translates XYZ in another language.
(Here XYZ stands for a specific section name mentioned below, such
as ``\textbf{Acknowledgements}'', ``\textbf{Dedications}'',
``\textbf{Endorsements}'', or ``\textbf{History}''.) To
``\textbf{Preserve the Title}'' of such a section when you modify
the Document means that it remains a section ``Entitled XYZ''
according to this definition.

The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document.  These
Warranty Disclaimers are considered to be included by reference in
this License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.


\begin{center}
{\Large\bf 2. VERBATIM COPYING\par} \phantomsection
\addcontentsline{toc}{section}{2. VERBATIM COPYING}
\end{center}

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License
applies to the Document are reproduced in all copies, and that you
add no other conditions whatsoever to those of this License.  You
may not use technical measures to obstruct or control the reading or
further copying of the copies you make or distribute.  However, you
may accept compensation in exchange for copies.  If you distribute a
large enough number of copies you must also follow the conditions in
section~3.

You may also lend copies, under the same conditions stated above,
and you may publicly display copies.


\begin{center}
{\Large\bf 3. COPYING IN QUANTITY\par} \phantomsection
\addcontentsline{toc}{section}{3. COPYING IN QUANTITY}
\end{center}


If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be
treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with
each Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free
of added material. If you use the latter option, you must take
reasonably prudent steps, when you begin distribution of Opaque
copies in quantity, to ensure that this Transparent copy will remain
thus accessible at the stated location until at least one year after
the last time you distribute an Opaque copy (directly or through
your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies,
to give them a chance to provide you with an updated version of the
Document.


\begin{center}
{\Large\bf 4. MODIFICATIONS\par} \phantomsection
\addcontentsline{toc}{section}{4. MODIFICATIONS}
\end{center}

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it.  In addition, you must do these things in
the Modified Version:

\begin{itemize}
\item[A.]
   Use in the Title Page (and on the covers, if any) a title distinct
   from that of the Document, and from those of previous versions
   (which should, if there were any, be listed in the History section
   of the Document).  You may use the same title as a previous version
   if the original publisher of that version gives permission.

\item[B.]
   List on the Title Page, as authors, one or more persons or entities
   responsible for authorship of the modifications in the Modified
   Version, together with at least five of the principal authors of the
   Document (all of its principal authors, if it has fewer than five),
   unless they release you from this requirement.

\item[C.]
   State on the Title page the name of the publisher of the
   Modified Version, as the publisher.

\item[D.]
   Preserve all the copyright notices of the Document.

\item[E.]
   Add an appropriate copyright notice for your modifications
   adjacent to the other copyright notices.

\item[F.]
   Include, immediately after the copyright notices, a license notice
   giving the public permission to use the Modified Version under the
   terms of this License, in the form shown in the Addendum below.

\item[G.]
   Preserve in that license notice the full lists of Invariant Sections
   and required Cover Texts given in the Document's license notice.

\item[H.]
   Include an unaltered copy of this License.

\item[I.]
   Preserve the section Entitled ``History'', Preserve its Title, and add
   to it an item stating at least the title, year, new authors, and
   publisher of the Modified Version as given on the Title Page.  If
   there is no section Entitled ``History'' in the Document, create one
   stating the title, year, authors, and publisher of the Document as
   given on its Title Page, then add an item describing the Modified
   Version as stated in the previous sentence.

\item[J.]
   Preserve the network location, if any, given in the Document for
   public access to a Transparent copy of the Document, and likewise
   the network locations given in the Document for previous versions
   it was based on.  These may be placed in the ``History'' section.
   You may omit a network location for a work that was published at
   least four years before the Document itself, or if the original
   publisher of the version it refers to gives permission.

\item[K.]
   For any section Entitled ``Acknowledgements'' or ``Dedications'',
   Preserve the Title of the section, and preserve in the section all
   the substance and tone of each of the contributor acknowledgements
   and/or dedications given therein.

\item[L.]
   Preserve all the Invariant Sections of the Document,
   unaltered in their text and in their titles.  Section numbers
   or the equivalent are not considered part of the section titles.

\item[M.]
   Delete any section Entitled ``Endorsements''.  Such a section
   may not be included in the Modified Version.

\item[N.]
   Do not retitle any existing section to be Entitled ``Endorsements''
   or to conflict in title with any Invariant Section.

\item[O.]
   Preserve any Warranty Disclaimers.
\end{itemize}

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
material copied from the Document, you may at your option designate
some or all of these sections as invariant.  To do this, add their
titles to the list of Invariant Sections in the Modified Version's
license notice. These titles must be distinct from any other section
titles.

You may add a section Entitled ``Endorsements'', provided it
contains nothing but endorsements of your Modified Version by
various parties--for example, statements of peer review or that the
text has been approved by an organization as the authoritative
definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and
a passage of up to 25 words as a Back-Cover Text, to the end of the
list of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document
already includes a cover text for the same cover, previously added
by you or by arrangement made by the same entity you are acting on
behalf of, you may not add another; but you may replace the old one,
on explicit permission from the previous publisher that added the
old one.

The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.


\begin{center}
{\Large\bf 5. COMBINING DOCUMENTS\par} \phantomsection
\addcontentsline{toc}{section}{5. COMBINING DOCUMENTS}
\end{center}


You may combine the Document with other documents released under
this License, under the terms defined in section~4 above for
modified versions, provided that you include in the combination all
of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your combined
work in its license notice, and that you preserve all their Warranty
Disclaimers.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name
but different contents, make the title of each such section unique
by adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique
number. Make the same adjustment to the section titles in the list
of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled
``History'' in the various original documents, forming one section
Entitled ``History''; likewise combine any sections Entitled
``Acknowledgements'', and any sections Entitled ``Dedications''. You
must delete all sections Entitled ``Endorsements''.

\begin{center}
{\Large\bf 6. COLLECTIONS OF DOCUMENTS\par} \phantomsection
\addcontentsline{toc}{section}{6. COLLECTIONS OF DOCUMENTS}
\end{center}

You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
rules of this License for verbatim copying of each of the documents
in all other respects.

You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert a
copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.


\begin{center}
{\Large\bf 7. AGGREGATION WITH INDEPENDENT WORKS\par}
\phantomsection \addcontentsline{toc}{section}{7. AGGREGATION WITH
INDEPENDENT WORKS}
\end{center}


A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage
or distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

If the Cover Text requirement of section~3 is applicable to these
copies of the Document, then if the Document is less than one half
of the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic
form. Otherwise they must appear on printed covers that bracket the
whole aggregate.


\begin{center}
{\Large\bf 8. TRANSLATION\par} \phantomsection
\addcontentsline{toc}{section}{8. TRANSLATION}
\end{center}


Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of
section~4. Replacing Invariant Sections with translations requires
special permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also
include the original English version of this License and the
original versions of those notices and disclaimers.  In case of a
disagreement between the translation and the original version of
this License or a notice or disclaimer, the original version will
prevail.

If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section~4) to
Preserve its Title (section~1) will typically require changing the
actual title.


\begin{center}
{\Large\bf 9. TERMINATION\par} \phantomsection
\addcontentsline{toc}{section}{9. TERMINATION}
\end{center}


You may not copy, modify, sublicense, or distribute the Document
except as expressly provided for under this License.  Any other
attempt to copy, modify, sublicense or distribute the Document is
void, and will automatically terminate your rights under this
License.  However, parties who have received copies, or rights, from
you under this License will not have their licenses terminated so
long as such parties remain in full compliance.


\begin{center}
{\Large\bf 10. FUTURE REVISIONS OF THIS LICENSE\par} \phantomsection
\addcontentsline{toc}{section}{10. FUTURE REVISIONS OF THIS LICENSE}
\end{center}


The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time.  Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.  See
http://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered version
of this License ``or any later version'' applies to it, you have the
option of following the terms and conditions either of that
specified version or of any later version that has been published
(not as a draft) by the Free Software Foundation.  If the Document
does not specify a version number of this License, you may choose
any version ever published (not as a draft) by the Free Software
Foundation. }






 \clearpage
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\lhead[\rm\thepage]{\nouppercase{\textcolor{blue}{\it\rightmark}}}
\rhead[\nouppercase{\textcolor{blue}{\it\leftmark}}]{\rm \thepage}
\renewcommand{\chaptermark}[0]{\markboth{\chaptername\ \thechapter}}
\renewcommand{\sectionmark}{\markright}


\chapter{Generating Functions}
\Opensolutionfile{discans}[discansC6]



\section{Ordinary Generating Functions}
Suppose we desire to change a dollar bill with pennies, nickels,
dimes, quarters and half-dollars. In how many ways can we do this?



This problem is equivalent to finding the number of nonnegative
solutions to the equation $$ x + 5y + 10z + 25w + 50v = 100.$$It
is easy to see that this is the same as asking for the coefficient
of $x^{100}$ in the expansion of
$$ \begin{array}{lcl} C(x) & = & (1 + x + x^2 + x^3 + \ldots) \\
&  & \cdot (1 + x^5 + x^{10} + x^{15} + \ldots ) \\
& &\quad \cdot (1 + x^{10} + x^{20} + x^{30} + \ldots ) \\
&  & \quad\cdot (1 + x^{25} + x^{50} + x^{75} + \ldots ) \\
&  & \quad\cdot (1 + x^{50} + x^{100} + x^{150} + \ldots ) \\
& = & \frac{1}{(1 - x)(1 - x^5 )(1 - x^{10})(1 - x^{25})(1 -
x^{50})}.
\end{array}$$
We call the function $C$ the {\em ordinary generating function} of
the change-making problem. We see that in general, the coefficient
of $x^n$ in the expansion of $C(x)$ gives us the number of
nonnegative solutions to the equation $$ x + 5y + 10z + 25w + 50v
= n.$$


In general, we call the function $$ G(x) = \sum _{n = 0} ^\infty
a_n x^n
$$ the {\em ordinary generating function} of the sequence $a_0 , a_1 , a_2 ,
\ldots .$
\begin{exa} Devise a pair of dice with exactly the same outcomes as ordinary dice (the sum $2$ comes out
once, etc.), but which are not ordinary dice. \end{exa} Solution:
Think of the ordinary die as the polynomial $$x + x^2 + x^3 + x^4
+ x^5 + x^6.$$ The outcomes of the ordinary pair of dice occur
then as the terms of  $$(x + x^2 + x^3 + x^4 + x^5 + x^6)^2,
$$that is, the coefficients of the polynomial
$$x^2 + 2x^3 + 3x^4 + 4x^5 +
5x^6 + 6x^7 + 5x^8 + 4x^9 + 3x^{10} + 2x^{11} + x^{12}$$tell us
that 2 occurs once, 3 occurs twice, etc..


We are thus looking for $a_i$ and $b_j$ such that $$(x^{a_1} +
\cdots + x^{a_6})(x^{b_1} + \cdots + x^{b_6}) = (x + \cdots +
x^6)(x + \cdots + x^6),$$i.e., an alternate factorisation for the
dextral side of this equality.  Now \begin{eqnarray*}
x + \cdots + x^6 & = & x\frac{1 - x^6}{1 - x}\\
& = & x\frac{1 - x^3}{1 - x}(1 + x^3)\\
& = & x(1 + x + x^2)(1 + x)(1 - x + x^2).
\end{eqnarray*}
The factors we seek must multiply to $$x^2 (1 + x + x)^2(1 +
x)^2(1 - x + x^2)^2.$$  Each factor must have an $x$ (the
condition of having {\em positive} entries) and each factor must
have a $1 + x$ and $1 + x + x^2$ (the condition of having 6 faces,
meaning that the value a $x = 1$ is 6). The only free choice is on
the distribution of the two $1 - x + x^2$ factors. If we give one
to each we get ordinary dice so we must try the other way.  Thus
we take the polynomials
$$ x(1 + x + x^2)(1 + x) = x + 2x^2 + 2x^3 + x^4$$and
$$ x(1 + x + x^2)(1 + x)(1 - x + x^2)^2 = x + x^3 + x^4 + x^5 + x^6 + x^8.$$
Therefore, if one die reads$$1,2,2,3,3,4$$ and the other reads
$$ 1, 3, 4, 5, 6, 8,$$we meet the conditions of the problem.
\begin{exa} Prove that the positive integers cannot be partitioned
into a finite number of sets $S_1 , S_2 , \ldots , S_n$ each of
which is an infinite arithmetic progression each with different
common difference. \end{exa} Solution: Assume on the contrary that
$$\BBN = S_1 \cup S_2 \cup \cdots \cup S_n,$$with $S_k = \{ a_k +
d_k , a_k + 2d_k , a_k + 3d_k , \ldots ,\} , 1 \leq k \leq n, d_1
> d_2 > d_3 > \cdots > d_n.$  Then
$$ \sum _{m \in \BBN} z^m = \sum _{m\in S_1} z^m + \sum _{m\in S_2} z^m +
\cdots + \sum _{m\in S_n} z^m ,$$that is to say,
$$ \frac{z}{1 - z} = \frac{z^{a_1}}{1 - z^{d_1}} + \frac{z^{a_2}}{1 -
z^{d_2}} + \cdots + \frac{z^{a_n}}{1 - z^{d_n}}.$$Letting
$z\rightarrow e^{2\pi i/d_1}$, the sinistral side is finite, but
the dextral side is infinite. This contradiction establishes the
claim.

\begin{exa} Partition the non-negative integers into two sets, $A$ and $B$,
such that every positive integer is expressible by $a + a'; a <
a'; a, a' \in A$ in the same number of ways as by $b + b'; b < b';
b, b' \in B.$\end{exa} Solution:   Consider the generating
functions $$ A(x) = \sum _{a \in A} x^a \ {\rm and} \ B(x) = \sum
_{b \in B} x^b .$$Observe that the conditions stipulate $$A(x) +
B(x) = \frac{1}{1 - x}$$ and $$A^2(x) - A(x^2) = B^2(x) -
B(x^2).$$  Thus
$$ (A(x) - B(x))(A(x) + B(x)) = A(x^2) - B(x^2),$$
and so
$$ A(x) - B(x) = (1 - x)(A(x^2) - B(x^2)).$$
Iterating gives
$$ A(x) - B(x) = \prod _{n = 0} ^{N - 1} (1 - x^{2^n})(A(x^{2^n}) -
B(x^{2^N})),$$ and letting $N \rightarrow \infty$ gives
$$ A(x) - B(x) = \prod _{n = 0} ^{\infty} (1 - x^{2^n}).$$
This product, when multiplied out, gives $+ x^k$ if $k$ is the sum
of an even number of distinct powers of 2 and $-x^k$ if $k$ is and
odd
number of them. This means that\\
A = Set of all integers with an even number of 1 digits in its
binary
representation.\\
B = Those with an odd number of 1 digits.\\
So $$ A = {0, 3, 5, 6, 9, 10, 12, 15, \ldots},$$
$$ B = {1, 2, 4, 7, 8, 11, 13, 14, \ldots} .$$


\section{OGFs and Linear Equations}

We now present some examples of how ordinary generating functions
can be used to find integral solutions to linear equations.

\begin{exa} Find the number of integer solutions of
$$x_1 + x_2 + x_3 + x_4 = 69,$$with $x_1 \geq 0, x_2 > 3, x_3 > 55, x_4 >
0.$ \end{exa} Solution: We are asking for the coefficient of
$x^{69}$ in the expansion of $$ (1 + x + x^2 + x^3 + \ldots
)\cdots(x^{4} + x^5 + x^6 + \ldots  )$$  $$ \qquad \cdot  (x^{56}
+ x^{57} + x^{58} + \ldots )(x + x^2 + x^3 + \ldots ) .$$But this
expression equals $$ \frac{1}{1 - x}\cdot\frac{x^4}{1 -
x}\cdot\frac{x^{56}}{1 - x}\cdot\frac{x}{1 - x} = \frac{x^{61}}{(1
- x)^4} .$$By the Generalised Binomial Theorem, the coefficient of
$x^{8}$ in the expansion of $(1 - x)^{-4}$ is
$$(-1)^8\binom{-4}{8} =
\frac{(-4)(-5)(-6)(-7)(-8)(-9)(-10)(-11)}{8!} = 165. $$
\begin{exa} Find the generating function for the number of integer
solutions of
$$ x_ 1 + x_2 + x_3 + x_4 + x_5 = n $$ with $0 \leq x_k \leq 4$ for all $k$
. Then, find the number of integer solutions to $x_1 + x_2 +
\cdots + x_5 = 10$ with $0 \leq x_k \leq 4.$ \end{exa} Solution:
The generating function is easily seen to be $$ (1 + x + x^2 + x^3
+ x^4)^5  = (1  - x)^{-5}(1 - x^5)^5 . $$


For the second part of the problem, we want the coefficient of
$x^{10}$ in the expansion of the above generating function. But by
the Generalised Binomial Theorem, this is $$
\binom{-5}{10}\binom{5}{0} + \binom{-5}{5}\binom{5}{1} +
\binom{-5}{0}\binom{5}{2}.$$
\begin{exa} Find the generating function for the number of integer
solutions of
$$ x_1 + x_2 + x_3 + x_4 = n$$ if $x_1 \geq 0, x_2 \geq 2, x_3 \geq 8, 0
\leq x_4 > 4.$ \end{exa} Solution: We want $$(1 + x + x^2 + \cdots
)(x^2 + x^3 + x^4 + \cdots ) (x^8 + x^9 + x^{10} + \cdots )(x^5 +
x^6 + x^7 + \cdots ) $$ which simplifies to $$\frac{x^{15}}{(1 -
x)^4}.$$
\begin{exa} Find the generating function for the number of integer
solutions of
$$ x_1 + x_2 + x_3 + x_4 = n$$ with $0 \leq x_1 \leq x_2 \leq x_3 \leq
x_4 .$ \end{exa} Solution: Make the change of variables $y_1 =
x_1, y_2 = x_2 - x_1 , y_3 = x_3 - x_2 , y_4 = x_4 - x_3.$ Then
$x_1 + x_2 + x_3 + x_4 = 4y_1 + 3y_2 + 2y_3 + y_4 .$ Thus we want
nonnegative solutions to the equation $$ 4y_1 + 3y_2 + 2y_3 + y_4
= n.$$The generating function for the number of solutions of this
last equation is easily seen to be
$$ (1 + x^4 + x^8 + \cdots )(1 + x^3 + x^6 + \cdots )(1 + x^2 + x^4 +
\cdots )(1 + x + x^2 + x^3 + \cdots )$$which in turn equals
$$ \frac{1}{1 - x^4}\cdot\frac{1}{1 - x^3}\cdot\frac{1}{1 -
x^2}\cdot\frac{1}{1 - x}.$$
\begin{exa} Find the generating function for the number of integral
solutions to $$ x_1 + x_2 + \cdots + x_r = n, $$with $x_k \geq k.$
\end{exa} Solution: The generating function is seen to be
$$ (x + x^2 + \cdots )(x^3 + x^4 + \cdots )\cdots (x^r + x^{r + 1} +
\cdots ) = \frac{x^{r(r + 1)/2}}{(1 - x)^r}.$$


\section{Difference Calculus}
We define the {\em forward difference operator} as
$$\Delta f(x) = f(x + 1) - f(x).$$
For example:
$$\Delta x^2 = (x + 1)^2 - x^2 = 2x + 1.$$
$$\Delta 2^x = 2^{x + 1} - 2^x = 2^x.$$
\begin{eqnarray*}
\Delta \sin x & = & \sin(x + 1) - \sin x \\
& = & \sin (x + \frac{1}{2} + \frac{1}{2}) - \sin (x + \frac{1}{2} - \frac{1}{2})\\
& = & \sin (x + \frac{1}{2}) \cos (\frac{1}{2}) + \sin (\frac{1}{2}) \cos (x + \frac{1}{2}) \\
& & \qquad - \sin (x + \frac{1}{2}) \cos (\frac{1}{2}) + \sin (\frac{1}{2}) \cos(x + \frac{1}{2})\\
& = & 2 \sin(\frac{1}{2}) \cos (x + \frac{1}{2}).
\end{eqnarray*}
We define the {\em iterated differences} by the recursion
$$\Delta^1 = \Delta, \hspace{7mm} \Delta^n = \Delta(\Delta^{n - 1}) \   {\rm for} \ n > 1.$$
We also define the {\em forward unit push} operator as
$$ E f(x) = f(x + 1).$$
For example, $E x^2 = (x + 1)^2 = x^2 + 2x + 1$. We note in
passing, that
$\Delta = E - 1.$  For example,\\
\begin{eqnarray*}
\Delta x^2 & = & (E - 1) x^2\\
& = & E x^2 - x^2\\
& = & (x + 1)^2 - x^2.\\
\end{eqnarray*}

If $m > 0$ is a positive integer, we define
$$x^{(m)} = x(x - 1)(x - 2) \cdots (x - m + 1).$$
We define $x^{(0)} = 1$.  Observe that $$ x^{(m + 1)} = x^{(m)} (x
- m) \hspace{8mm}(*).$$ How must we define $x^{(m)}$ for negative
integer $m$? Let $m = -1$ in $(*)$.  We get
$$x^{(0)} = x^{(-1)} (x + 1)$$
Since $x^{(0)} = 0$ we obtain $x^{(-1)} = \frac{1}{x + 1}.$  By
recursion we see that
$$ x^{(m)} = \frac{1}{(x + 1)(x + 2) \cdots (x + m)}$$
for negative integer $m$.

With $x^{(n)}$ and the operator $\Delta$ we obtain formul\ae \
analogous to the differentiation formul\ae . We can prove that
$\Delta x^{(n)} = nx^{(n - 1)}$. To see this, assume first that
$n$ is a positive integer. Then
\begin{eqnarray*}\Delta x^{(n)} & = & (x + 1)^{(n)} - x^{(n)} \\
& = & (x + 1)(x)(x - 1)\cdots (x + 1 - n + 1) \\ & & \qquad  - x(x
-
1)\cdots (x - n + 1) \\ & = & x^{(n - 1)}((x + 1) - (x - n + 1)) \\
& = & x^{(n - 1)}n,\end{eqnarray*}as wanted. If $n$ is a negative
integer, the proof is similar.






The operators $E$ and $\Delta$ are quite useful in obtaining $n$-th terms of sequences.\\
Let $u_0, u_1, u_2, u_3, \cdots$ be a sequence. We see that
$$ u_1 = E u_0 $$
$$ u_2 = E u_1 = E^2 u_0$$
$$ u_3 = E u_2 = E^2 u_1 = E^3 u_0$$
and in general, $u_k = E^k u_0.$ Now, as $E = \Delta + 1$, we
obtain $u_k = (1 + \Delta)^k u_0,$ and upon using the Binomial
Theorem,
$$ u_k = \sum _{j = 0} ^k \binom{k}{j} \Delta^j u_0.$$
We need thus to find the quantities $\Delta^j u_0, j = 0, 1, 2,
\cdots$.



But on considering the following array
$$\begin {array}{cccccc} u_0 & & u_1 & & u_2 &  \ldots\\
 & u_1 - u_0 & & u_2 - u_1 & & u_3 - u_2  \ldots\\
 & & u_2 - 2u_1 + u_0 & & u_3 - 2u_2 + u_1 & \ldots \end{array}$$
which can be written as
$$ \begin {array}{ccccccc} u_0 & & u_1 & & u_2 & & u_3 \ldots\\
 & \Delta u_0 & & \Delta u_1 & & \Delta u_2 & \ldots\\
 & & \Delta^2 u_0 & & \Delta^2 u_1 & & \Delta^2 u_2  \ldots\\
 & & & \Delta^3 u_0 & & \Delta^3 u_1 \ldots\end{array}$$
Thus the  sought quantities are on the first diagonal of the above
array.


We now present a few examples
\begin{exa} Find the $n$-th term of the sequence $4, 14, 30, 52, 80, 114,
\cdots$, assuming that it grows polynomially. \end{exa} Solution:
We form the difference table
$$ 4, 14, 30, 52, 80, 114, \ldots$$
$$ 10, 16, 22, 28, 34, \ldots$$
$$ 6, 6,, 6, 6, \ldots$$
$$ 0, 0, 0, \ldots$$
Thus $u_0 = 4, \Delta u_0 = 10, \Delta^2 u_0 = 6, \Delta^3 u_0 =
0$ for $j \geq 3.$ Now, by the Binomial Theorem,
\begin{eqnarray*}
u_n = E^n u_0 & = & (1 + \Delta)^n u_0\\
& = & 1 \cdot u_0 + \binom{n}{1} \Delta^1 u_0 + \binom{n}{2} \Delta^2 u_0 + \binom{n}{3} \Delta^3 u_0 + \cdots \\
& = & u_0 + \binom{n}{1} \Delta u_0 + \binom{n}{2} \Delta^2 u_2\\
& = & 4 + \binom{n}{1} 10 + \binom{n}{2} 6\\
& = & 4 + 10n + 3n(n - 1)\\
& = & 3n^2 + 7n + 4.\\
\end{eqnarray*}
\begin{exa}   Find the $n$-th term of $8, 16, 0, -64, -200, -432, \ldots$,
assuming that it grows polynomially. \end{exa} Solution: Form the
table of differences
$$ 8, 16, 0, -64, -200, -432, \ldots$$
$$ 8, -16, -64, -136, -232, \ldots$$
$$ -24, -48, -72, -96, \ldots$$
$$ -24, -24, -24, \ldots$$
Thus $u_0 = 8, \Delta u_0 = 8, \Delta^2 u_0 = -24, \Delta^3 u_0 =
-24$ and $\Delta^j u_0 = 0$ for $j \geq 4.$ Hence by the Binomial
Theorem, and since $u_n = E^n u_0 = (1 + \Delta )^n u_0$,
\begin{eqnarray*}
u_n = (1 + \Delta)^n u_0 & = & \binom{n}{0} u_0 + \binom{n}{1}\Delta u_0 + \binom{n}{2} \Delta^2 u_0 + \binom{n}{3}\Delta^3 u_0 + \cdots \\
& = & 8 + 8n - 24 \frac{n(n - 1)}{2} - 24 \frac{n(n - 1)(n - 2)}{6}\\
& = & 8 + 8n - 12n(n - 1) - 4n(n - 1)(n - 2)
\end{eqnarray*}

\begin{exa} Evaluate $\frac{1}{1 - \Delta} n^2.$ \end{exa}
\begin{eqnarray*}
\frac{1}{1 - \Delta} & = & (1 + + \Delta + \Delta ^2 + \Delta ^3 + \cdots)n^2\\
& = & (1 + \Delta + \Delta ^2 + \Delta ^3 + \cdots)[n^{(2)} + n^{(1)}]\\
& = & n^{(2)} + n^{(1)} + 2n^{(1)} + 1 + 2 + 0\\
& = & n^{(2)} + 3n^{(1)} + 3
\end{eqnarray*}
\begin{exa} Evaluate $\frac{1}{E^2 - 5E + 6} \ n.$ \end{exa}
\begin{eqnarray*}
\frac{1}{E^2 - 5E + 6}n & = & \frac{1}{(E - 2)(E - 3)}n\\
& = & -(\frac{1}{E - 2} - \frac{1}{E - 3})n\\
& = & -\frac{1}{E - 2}n + \frac{1}{E - 3}n\\
& = & -\frac{1}{\Delta - 1}n + \frac{1}{\Delta - 2}n\\
& = & \frac{1}{1 - \Delta}n + \frac{-\frac{1}{2}}{1 - \frac{\Delta}{2}}n\\
& = & (1 + \Delta + \Delta^2 + \Delta^3 + \cdots )n^{(1)} \\
& & \quad - (\frac{1}{2})(1 + \frac{\Delta}{2} + \frac{\Delta^2}{4} + \frac{\Delta^3}{8} + \cdots)n\\
& = & n^{(1)} + 1 - \frac{1}{2}9n^{(1)} + \frac{1}{2})\\
& = & \frac{1}{2}n^{(1)} + \frac{3}{4}
\end{eqnarray*}
\begin{exa} Find $$ \frac{1}{1 - \Delta} k^{(3)}.$$ \end{exa}
Solution: Expanding $\frac{1}{1 - \Delta}$ in powers of $\Delta$,
\begin{eqnarray*} \frac{1}{1 - \Delta} k^{(3)} & = & (1 + \Delta + \Delta ^2 + \Delta ^3 + \Delta ^4 + \cdots) k^{(3)}\\
& = & k^{(3)} + \Delta k^{(3)} + \Delta ^2 k^{(3)} + \Delta ^3 k^{(3)} + \Delta ^4 k^{(3)} + \cdots \\
& = & k^{(3)} + 3k^{(2)} + 6k^{(1)} + 6 + 0 + 0 + \cdots \\
& = & k^{(3)} + 3k^{(2)} + 6k^{(1)} + 6.\end{eqnarray*}



\section{Sum Calculus}
The operator $\Delta$ is analogous to the differential operator.
What is the analogue for integration? Of course, we know from
Calculus that summation and integration are related, and
integration is the inverse (in some way) of differentiation. We
are thus going to attach the symbol $\frac{1}{\Delta} = \Delta
^{-1}$ with the meaning ``summation'', i.e. $\Delta ^{-1} = \sum
.$ In analogy to integration, we have $$ \Delta ^{-1} x^{(n)} =
\sum x^{(n)} = \frac{x^{(n + 1)}}{n + 1} + C\hspace{7mm} n\in\BBZ,
\ n\neq -1,$$where $C$ is the summation constant. For example,
$\Delta ^{-1} x^{(5)} = x^{(6)}/6 + C$ and $\Delta ^{(-2)} x^{(5)}
= \Delta ^{-1} (x^{(6)}/6  + C)= x^{(7)}/42 + C_1x^{(1)} + C_2.$


Now, what is analogous to definite integration? It must be $\sum
_{k = 1} ^n a_k .$ We first find the ``indefinite integral'' for
$a_k$. In analogy to differential Calculus, we seek for a sequence
whose first order difference is $a_k.$ Let $\Delta y_k = a_k.$
Then $y_{k + 1} - y_k = a_k.$ Summing from $k = 1$ to $k = n$,
$y_{n + 1} - y_1 = \sum _{k = 1} ^n a_k$, which is the quantity we
want. Thus if $y_k = \Delta ^{-1} a_k,$ then $\sum _{k = 1} ^n a_k
= y_k {\displaystyle \left| _1 ^{n + 1} \right. } = y_{n + 1} -
y_1.$


We now observe that we can sum a series by extending the
difference array upwards.
$$\begin{array}{cccccccccc}0 & & u_0 & & u_0 + u_1 & & u_0 + u_1 + u_2 & & u_0 + u_1 + u_2 + u_3 & \\
 & u_0 & & u_1 & & u_2 & & u_3 & & u_4 \end{array}$$
We just have to find the $n$-th term of the sequence of partial
sums.

\begin{exa}   Find a closed form for $\sum _{k = 1} ^n k^2.$\end{exa}
Solution: The sequence of partial sums is\\
$0$\\
$1^2 = 1$\\
$1^2 + 2^2 = 5$\\
$1^2 + 2^2 + 3^2 = 14$\\
$1^2 + 2^2 + 3^2 + 4^2 = 30$\\
$1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55$, etc.\\
We form the difference table for this sequence
$$ 0, 1, 5, 14, 30, 55, \ldots , $$
$$ 1, 4, 9, 16, 25, \ldots , $$
$$ 3, 5, 7, 9, \ldots , $$
$$ 2, 2, 2, \ldots , $$
$$ 0, 0, \ldots . $$
Thus $u_0 = 0, \Delta^1 u_0 = 1, \Delta^2 u_0 = 3, \Delta^3 u_0 =
2, \Delta^j u_0 = 0$ for $j \geq 4$ and so,
\begin{eqnarray*}
\sum _{k = 1}^n k^2 & = & u_n \\
& = & (1 + \Delta)^n u_0\\
& = & u_0 + \binom{n}{1} \Delta u_0 + \binom{n}{2} \Delta^2 u_0 + \binom{n}{3} \Delta^3 u_0\\
& = & n + \frac{3(n - 1)}{2} + \frac{n(n - 1)(n - 2)}{3}\\
& = & n(1 + \frac{3(n - 1)}{2} + \frac{(n - 1)(n - 2)}{3}\\
& = & n(\frac{6 + 9(n - 1) + 2(n - 1)(n - 2)}{6})\\
& = & \frac{n}{6} (6 + 9n - 9 + 2n^2 - 6n + 4)\\
& = & \frac{n}{6} (2n^2 + 3n + 1)\\
& = & \frac{n(n + 1)(2n + 1)}{6}
\end{eqnarray*}
as it is well known.

\begin{exa} Find a closed form for $\sum _{k = 1}^n k(k + 1).$ \end{exa}
Solution: Here  $u_0 = 0, u_1 = 2, u_2 = 8, u_3 = 20$ and we form
the difference array
$$ 0, \ 1, \ 5, \ 14, \ 30, \ 55, \ \ldots , $$
$$ 1, \ 4, \ 9, \ 16, \ 25, \ \ldots , $$
$$ 3, \ 5, \ 7, \ 9, \ \ldots , $$
$$ 2, \ 2, \ 2, \ \ldots , $$
and so $u_0 = 0, \Delta u_0 = 2, \Delta^2 u_0 = 4, \Delta^3 u_0 =
2$ whence
\begin{eqnarray*}
\sum _{k = 1}^n k(k + 1) = u_n & = & (1 + \Delta)^n u_0\\
& = & 1 + \binom{n}{1}u_0 + \binom{n}{2} \Delta^2 u_0 + \binom{n}{3} \Delta^3 u_0\\
& = & 1 + 2n + 2n(n - 1) + \frac{n(n - 1)(n - 2)}{3}.\\
\end{eqnarray*}

\begin{rem}  The above method only works for sequences that grow
polynomially, and hence their differences will ultimately be 0.
For if one tries to use this
to sum $\sum _{k = 1}^n k 2^k,$ one obtains a false result (say)\\
$$\sum _{k = 1}^n k 2^k = p(n), \hspace{8mm}{\rm (false).}$$ where $p$ is
a polynomial. The sinistral side is $>> n 2^n$ as $n \rightarrow
\infty$ but the dextral side is $<< n^{{\rm degree \ of} \ p}.$

\bigskip

The right formula can be obtained as follows.  Let
$$ f(x) = \sum _{k = 1}^n x^k = \frac{x^{n + 1} - x}{x - 1} = \frac{x^{n + 1}}{x - 1} - \frac{x}{x - 1}              $$
Differentiating,
\begin{eqnarray*}
f(x) & = & \sum _{k = 1}^n k x^{k - 1}\\
& = & \frac{(n + 1)x^n(x - 1) - x^{n + 1}}{(x - 1)^2} - \frac{x - 1 - x}{(x - 1)^2}\\
& = & \frac{nx^{n + 1} - (n + 1)x^n +1}{(x - 1)^2}
\end{eqnarray*}
Letting $x = 2$,
$$\sum _{k = 1}^n k 2^{k - 1} = n 2^{n + 1} - (n + 1) 2^n + 1$$
or $$\sum _{k = 1}^n k 2^k = n 2^{n + 2} - (n + 1)2^{n + 1} + 2.$$

\bigskip

Or one can also argue as follows. We have
$$ \begin{array}{lcl} S & = & 1\cdot 2 + 2\cdot 2^2 + 3\cdot 2^3  + \cdots + n\cdot 2^n \\
{2}S & = & 1\cdot 2^2 + 2\cdot 2^3 + 3\cdot 2^4 + \cdots + (n -
1)2^n + n\cdot 2^{n + 1} \end{array}$$ Upon subtraction, $S =
n\cdot 2^{n + 1} - 2^n - 2^{n - 1} - \cdots - 2^2 - 2.$ After
summing the geometric series, $S = n2^{n + 1} - 2^{n + 1}  + 2$,
which is the same formula as above.
\end{rem}
\begin{exa} Find $$ \frac{1}{E^2 - 2E + 1} k^2 .$$ \end{exa}
Solution: Observe that $E^2 - 2E + 1 = (1 + \Delta )^2 - 2(1 +
\Delta ) + 1 = \Delta ^2$. Also, $k^2 = k^{(2)} + k^{(1)}$. Thus
\begin{eqnarray*} \frac{1}{E^2 - 2E + 1} k^2 & = & \Delta ^{-2} k^{(2)} + k^{(1)} \\
& = & \Delta ^{-1}(\frac{k^{(3)}}{3} + \frac{k^{2}}{2} + C_1) \\
& = & \frac{k^{(4)}}{12} + \frac{k^{(3)}}{6} + C_1 k^{(1)} +
C_2.\end{eqnarray*}
\begin{exa} Express $k^3$ in the form $Ak^{(3)} + Bk^{(2)} + Ck^{(1)} + D$.
\end{exa} Solution: We want to express $k^3$ as
$$k^3 = A(k)(k - 1)(k - 2) + B(k)(k - 1) + Ck + D.$$Letting $k = 0$, we find $D = 0$.
Letting $k = 1,$ we find $C = 1$. Letting $k = 2,$ we find $B =
3.$ Now, $A = 1$ because the degrees of both expressions is 3, and
so the leading coefficients on both sides of the equality must
agree. Hence
$$ k^3 = k^{(3)} + 3k^{(2)} + k^{(1)}.$$
\begin{exa} Find the sum $\sum _{k = 1} ^n k^2.$ \end{exa}
Solution: First we express $k^2$ as falling factorials,
$$ k^2 = Ak^{(2)} + Bk^{(1)} + C$$ which is the same as
$$ k^2 = A(k)(k - 1) + Bk + C .$$
Let $k = 0.$
$$ 0^2 = A(0)(-1) + B(0) + C = C$$
Thus $c = 0.$ Let $k = 1.$
$$ 1^2 = A(1)(0) + B(1) + C = B$$
Thus $B = 1.$ Let $k = 2.$
$$ 2^2 = A(2)(1) + B(2) + C = 2A + 2$$
Thus $A = 1.$



Substituting in $A, B,$ and $C$, we obtain
$$ k^2 = k^{(2)} + k^{(1)}.$$
\begin{eqnarray*}
\sum _{k = 1}^n k^2 & = & \sum {k = 1}^n k^{(2)} + k^{(1)}\\
& = & \left. \frac{k^{(3)}}{3} + \frac{k^{(2)}}{2} \right| ^{n + 1} _{1}\\
& = & \frac{(n + 1)^{(3)}}{3} + \frac{(n + 1)^{(2)}}{2} - \frac{1^{(3)}}{3} - \frac{1^{(2)}}{2}\\
& = & \frac{(n + 1)(n)(n - 1)}{3} + \frac{n(n + 1)}{2}\\
& = & \frac{2n(n + 1)(n - 1) + 3n(n + 1)}{6}\\
& = & \frac{[n(n + 1)][2(n - 1) + 3]}{6}\\
& = & \frac{n(n + 1)(2n + 1)}{6}
\end{eqnarray*}


\section{Homogeneous recurrences}
If a recurrence relation has the form $$ a_0 y_{n + k} + a_1 y_{n
- 1 + k} + a_2 y_{n - 2 + k} + \cdots + a_n y_{k} = 0, $$ with
constants $a_k$, we call such a recurrence {\em linear and
homogeneous}. Since by means of the push operator we can express
this as
$$ (a_0 E^n + a_1 E^{n - 1} + \cdots + a_{n - 1}E + a_n) y_k = 0,$$we just have to determine
the roots of the polynomial in $E$. We get several cases depending
on the roots being all real and distinct, real and repeated, or
complex. We will examine these different cases in the examples
that follow.
\begin{exa} Solve the following difference equation:
$$ y_{k + 2} - 5y_{k + 1} + 6y_k = 0.$$ \end{exa}
Solution: Using the push operator,
\begin{eqnarray*}
y_{k + 2} - 5y_{k + 1} + 6y_k & = & E^2y_k - 5Ey_k + 6y_k\\
& = & (E^2 - 5E + 6) y_k\\
& = & (E - 3)(E - 2) y_k
\end{eqnarray*}
Thus $y_k = A \cdot 2^k + B \cdot 3^k$ for some constants $A$ and
$B$.
\begin{exa} Solve the initial value difference equation: $y_{k + 2} -
6y_{k + 1} + 8y_k = 0$ if $y_0 = 3$ and $y_1 = 2$.\end{exa}
Solution: Using the push operator, \begin{eqnarray*}
y_{k + 2} - 6y_{k + 1} + 8y_k & = & E^2 y_k - 6Ey_k + 8y_k\\
& = & (E^2 - 6E + 8)y_k\\
& = & (E - 4)(E - 2)y_k
\end{eqnarray*}
Thus $y_k = A \cdot 2^k + B \cdot 4^k$ for some constants $A$ and
$B$. From $y_0 = 3$ and $y_1 = 2$, we plug $k = 0$ and $k = 1$
into the equation to get $3 = A \cdot 2^0 + B \cdot 2^0 = A + B$
and $2 = A \cdot 2^1 + B \cdot 4^1 = 2A + 4B.$ We solve these
equations to get $A = 5$ and $B = -2.$  Thus
$$ y_k = 5 \cdot 2^k - 2 \cdot 4^k.$$
\begin{exa} Solve the difference equation $y_{k + 2} - 2y_{k + 1} + 5y_k =
0.$\end{exa} The equation can be written as $(E^2 - 2E + 5) y_k =
0.$ It follows that the solutions are $(1 + 2i)^k$ and $(1 -
2i)^k.$  Putting these into polar form, we get
$$ 1 + 2i = \sqrt{5}(\frac{1}{\sqrt{5}} + \frac{2}{\sqrt{5}}i) = \sqrt{5}(\cos\Theta + i\sin\Theta) = \sqrt{5}e^{i\Theta}$$
$$ 1 - 2i = \sqrt{5}(\frac{1}{\sqrt{5}} - \frac{2}{\sqrt{5}}i) = \sqrt{5}(\cos\Theta - i\sin\Theta) = \sqrt{5}e^{-i\Theta}$$
where $\tan \Theta = 2.$\\
It follows that the two linearly independent solutions are\\
$$ (\sqrt{5} e^{i \Theta})^k = (\sqrt{5})^k e^{ki\Theta} = 5^{\frac{k}{2}} e^{ki\Theta} = 5^{\frac{k}{2}}(\cos{k\Theta} + i\sin{k\Theta})$$and
$$ (\sqrt{5}e^{-i \Theta})^k = (\sqrt{5})^ke^{-ki\Theta} = 5^{\frac{k}{2}}e^{-ki\Theta} = 5^{\frac{k}{2}}(\cos{k\Theta} + i\sin{k\Theta}).$$
Here we have used Euler's Formula $e^{i\theta} = \cos \theta +
i\sin \theta$. The general solution can be written as
$$ y_k = 5^{\frac{k}{2}}(A\cos{k\Theta} + B\sin{k\Theta}).$$
\begin{exa} Solve the difference equation $y_{k + 2} - 4y_{k + 1} + 4y_k
= 0$ for $y_0 = 1$ and $y_1 = 3.$\end{exa} Solution:  Using the
push operator, $E^2y_k -4Ey_k + 4y_k = 0.$ This can be factored as
$(E - 2)(E - 2)y_k = 0.$  The general solution is thus
$$ y_k = A2^k + Bk2^k.$$
Substituting for $y_0$ and $y_1$ into the equation above, we get
the following: $$ 1 = A2^0 + B(0)(2^0) = A$$ and
$$ 3 = A2^1 + B(1)(2^1) = 2A + 2B.$$
Solving the equations, we get $A = 1$ and $B = \frac{1}{2}$. Thus
$$ y_k = 2^k + k2^{k - 1}.$$
\begin{exa} Solve the recurrence $$ y_{n + 3} - 2y_{n + 2} - y_{n + 1} +
2y_n = 0.$$ \end{exa} Solution: We must solve $$(E^3 - 2E^2 - E +
2)y_n = (E - 1)(E + 1)(E - 2)y_n = 0.$$ The general solution is $$
y_n = A + B(-1)^n + C(2)^n .$$
\begin{exa} Solve the recurrence $$ y_{n + 3} + 6y_{n + 2} + 12y_{n + 1} +
8y_n = 0.$$ \end{exa} Solution: We see that this is equivalent to
$(E + 2)^3 y_n = 0$. The solution is thus given by $$ y_n =
A(-2)^n + Bn(-2)^n + Cn^2(-2)^n .$$
\begin{exa} Solve the recurrence given by $$(E - 2)(E - 3)(E -
8)^{1994}y_{n} = 0. $$ \end{exa} Solution: The solution is readily
seen to be
$$ y_n = A(2)^n + B(3)^n + C_1 8^n + C_2 n8^n + C_3 n^2 8^n + \cdots + C_{1994}n^{1993}8^n .$$
\begin{exa} Solve $y_{k + 4} + 12y_{k + 2} - 64y_k = 0.$\end{exa}
Solution: The equation is converted into $(E^4 + 12E^2 - 64)y_k =
0,$ which can factored as $(E^2 + 16)(E^2 - 4)y_k = 0.$ This can
be factored again as $(E^2 + 16)(E - 2)(E + 2)y_k = 0.$  Factor
this two more times into $(E^2 - (4i)^2)(E - 2)(E + 2)y_k = 0$,
then $(E - 4i)(E + 4i)(E - 2)(E + 2)y_k = 0.$  The general
solution for $y_k$ is
$$ y_k = A2^k + B(-2)^k + C(4i)^k + D(-4i)^k.$$
\begin{exa} Solve the difference equation $2y_{k + 1} + 3y_k = 0.$\end{exa}
Solution: This is the same as $(2E + 3)y_k = (\frac{1}{2})(E +
\frac{3}{2})y_k = 0.$ Dividing by $\frac{1}{2}$ gives $(E +
\frac{3}{2})y_k = 0.$ The solution is $y_k = A(-\frac{3}{2})^k.$
\begin{exa} Solve the recursion $y_{k + 3} - 8y_k = 0$.\end{exa}
Solution: We have
\begin{eqnarray*}
y_{k + 3} - 8y_k & = & (E^3 - 8)y_k\\
& = & (E - 2)(E^2 + 2E + 4)y_k\\
& = & (E - 2)(E^2 + 2E + 1 + 3)y_k\\
& = & (E - 2)((E + 1)^2 + 3)y_k\\
& = & (E - 2)((E + 1)^2 - (i\sqrt{3})^2)y_k\\
& = & (E - 2)(E + 1 - i\sqrt{3})(E + 1 + i\sqrt{3})y_k
\end{eqnarray*}
Thus
$$ y_k = A2^k + B(i - 1)^k + C(-1 - i)^k.$$


\section{Inhomogeneous recurrences}
We now consider the case when the difference equation is
non-homogeneous.



We shall need several formal operator methods for our task. We
first prove the
following result. \\
\begin{thm}[Exponential shift] Let $F$ be a
polynomial in $n$. Let $\phi (E)$ be a polynomial on the push
operator. Then a particular solution to the equation
$$  \phi (E)y_n =  \alpha ^n F(n)$$is given by $$ y_{\rm particular} = \alpha ^n \frac{1}{\phi (\alpha E)}F(n).$$
\end{thm}
\begin{pf} Let $\phi (E) = \sum _{j = 0} ^m a_j E^j$. Then
\begin{eqnarray*}\phi (E) \alpha ^n F(n) &  = & \sum _{j = 0} ^m a_j E^j \alpha ^n F(n) \\
& = & \sum _{j = 0} ^m a_j \alpha ^{n + j} F(n + j) \\
& = & \alpha ^n \sum _{j = 0} ^m a_j \alpha ^{j} E^j F(n) \\
& = & \alpha ^n \phi (\alpha E)F(n). \end{eqnarray*} We conclude
that $\phi (E) \alpha ^n F(n) = \alpha ^n \phi (\alpha E)F(n).$
Thus
$$ \frac{1}{\phi (E)}\alpha ^n F(n) = \alpha ^n \frac{1}{\phi (\alpha E)}F(n).$$
\end{pf}
\begin{cor} If $\phi (\alpha ) \neq 0,$ then $y_n = \frac{\alpha
^n}{\phi (n)}$ is a particular solution to $$ \phi (E) y_n =
\alpha ^n .$$
\end{cor}


\begin{exa} Solve the recursion $$ y_{n + 2} - 5y_{n + 1} + 4y_n = 2\cdot
3^n - 4\cdot 7^n .$$ \end{exa} Solution: Using the push operator,
the equation is equivalent to $$(E^2 - 5E + 4)y_n = 2\cdot 3^n -
4\cdot 7^n.$$ The homogeneous solution is given by $y_n = A +
B4^n$. To find a particular solution to the inhomogeneous case, we
write
$$ y_n = \frac{1}{E^2 - 5E + 4}2\cdot 3^n - \frac{1}{E^2 - 5E + 4}4\cdot
7^n$$and use the Theorem of the Exponential shift
$$\begin{array}{lcl}y_{\rm particular} & = & 3^n\frac{1}{3^2 - 5(3) + 4}2  - 7^n\frac{1}{7^2 - 5(7) + 4}4 \\
& = & -3^n - \frac{2}{9}7^n . \end{array}$$The complete solution
is given by the sum of the homogeneous and the particular solution
$$y_n = A + B4^n - 3^n - \frac{2}{9}7^n .$$
\begin{exa}[Putnam 1980] For which real numbers $a$ does the sequence
defined by the initial condition $u_0 = a$ and the recursion $u_{n
+ 1} = 2u_n - n^2$ have $u_n > 0$ for all $n \geq 0$?  (Express
the answer in simplest form.)\end{exa} Solution:  We will shew
that $u_n > 0$ for all $n \geq 0$ if and only if $a \geq 3$.  Let
$\Delta u_n = u_{n + 1} - u_n.$  The difference equation takes the
form $(1 - \Delta )u_n = n^2$.  Since $n^2$ is a polynomial, a
particular solution is
$$ u_n = (1 + \Delta )^{-1}n^2 = (1 + \Delta + \Delta ^2 + \cdots )n^2 =
n^2 + (2n + 1) + 2 $$ or $$ u_n = n^2 + 2n + 3.$$ Hence, the
complete solution is $u_n = n^2 + 2n + 3 + k \cdot 2^n$, since
$v_n = k \cdot 2^n$ is the solution of the associated homogeneous
difference equation $v_{n + 1} - 2v_n = 0.$  The desired solution
with $u_0 = a$ is $u_n = n^2 + 2n + 3 + (a - 3)2^n.$  Since
$\lim_{n \rightarrow \infty} [2^n/(n^2 + 2n + 3)] = +\infty, u_n$
will be negative for large enough $n$ if $a - 3 < 0.$
Conversely, if $a - 3 \geq 0$, it is clear that each $u_n > 0.$\\

\begin{exa} Find a particular solution for the recursion $$y_{n + 2} -
5y_{n + 1} + 4y_n = n^2\cdot 3^n.$$ \end{exa} Solution: A
particular solution is given by $$ y_n = \frac{1}{E^2 - 5E + 4} \
n^23^n .$$ Using the exponential shift theorem,
$$\begin{array}{lcl} y_n & = & 3^n\frac{1}{(3E)^2 - 5(3E) + 4}n^2 \\
 & = & 3^n\frac{1}{(3E - 4)(3E - 1)}n^2 \\
& = & 3^n\frac{-1/3}{3E - 1} \ n^2  + 3^n\frac{1/3}{3E - 4} \ n^2 \\
& = & 3^n\cdot\frac{-1/3}{2 + 3\Delta} \ n^{(2)} + n^{(1)} +
3^n \cdot\frac{1/3}{3\Delta - 1} \ n^{(2)} + n^{(1)} \\
& = & \frac{-3^{n - 1}}{2}(1 - \frac{3}{2}\Delta +
\frac{9}{4}\Delta
^2  + \cdots ) n^{(2)} + n^{(1)}  \\
& & \quad - 3^{n - 1}(1 + 3\Delta + 9\Delta ^2  + \cdots ) n^{(2)} + n^{(1)} \\
& = & \frac{-3^{n - 1}}{2}(n^{(2)} - \frac{1}{2}n^{(1)} + 3) \\
& & \quad - 3^{n - 1}(n^{(2)} + 4n^{(1)} + 21).
\end{array}$$
\begin{exa} Find a particular solution for the recursion $$ y_n - 3y_{n -
1} = 3^n.$$ \end{exa} Solution: The equation is $(E - 3) y_{n - 1}
= 3^n$. A particular solution is given by $$ y_{n - 1} =
\frac{1}{E - 3} 3^n. $$Using the exponential shift theorem, $$
y_{n - 1} = 3^{n} \frac{1}{3E - 3} 1 = 3^{n - 1} \Delta ^{-1}1 =
3^{n - 1}(n^{(1)} + C),$$where $C$ is a constant. Since the
homogeneous solution is of the form $A3^n$ the general solution is
$y_{n - 1} = A3^n + n3^{n - 1}$ or $y_n = A3^n + n3^n.$ (Notice
how $C3^n$ and other constants $\times 3^n$ were absorbed in $A$.)
\begin{exa} Solve the recursion $$ y_n - 3y_{n - 1} = n + 2.$$
\end{exa} Solution: A
particular solution is given by $y_{n - 1} = \frac{1}{E - 3}
n^{(1)} + 2 = \frac{-1}{2}\cdots\frac{1}{1 - \Delta /2} n^{(1)} +
2 = -\frac{1}{2}(1 + \Delta /2 + \Delta ^2 /4 + \cdots ) n^{(1)} +
2 = -n/2 - 5/4.$ Thus the general solution is given by $$ y_{n -
1} = A3^n - n/2 - 5/4$$or
$$ y_n = A3^n -n/2 - 7/4.$$
\begin{exa} Solve the recursion $$ y_n - 2y_{n - 1} + y_{n - 2} =
2^n.$$ \end{exa} Solution: A particular solution is given by $y_{n
- 2} = \frac{1}{(E - 1)^2} 2^n = 2^n \frac{1}{(2 - 1)^2} 1 = 2^n$,
where we have used the corollary to the exponential shift theorem.
It follows that the general solution to the recursion is given by
$y_{n - 2} = A + Bn + 2^n$ or, what is the same, $y_n = A + Bn +
2^{n + 2}$.
\begin{exa} Solve the recursion $y_n - 2y_{n - 1} + y_{n - 2} = 4.$ \end{exa}
Solution: A particular solution is given by $y_{n - 2} =
\frac{1}{(E - 1)^2} 4= \Delta ^{-2} 4 = 2n^{(2)} + Cn^{(1)} + C_1
= 2n^2 + Cn + C_1.$ The general solution is thus given by $y_{n -
2} = A + Bn + 2n^2.$


\section{Generalised Binomial Theorem}
If $x$ is any real number, we may define formally the symbol
$\binom{x}{n}, n \in\BBN$ as
$$\binom{x}{n} = \frac{x(x - 1)(x - 2) \cdots (x - (n - 1))}{n!}.$$Thus $\binom{x}{n}$ is a polynomial of
degree $n$ in $x$. We take the convention that $\binom{x}{n} = 0$
if $n$ is not a nonnegative integer. If $n = 0,$ we define
$\binom{x}{0}$ as 1.



One formula which is particularly helpful is the {\em upper
negation} formula: \begin{equation} \binom{-x}{n} = (-1)^n
\binom{x + n - 1}{n} \hspace{10mm} n \in \BBZ, n \geq
0.\end{equation}Its proof is easy:
$$ \binom{-x}{n} = \frac{(-x)(-x - 1) \cdots (-x - n + 1)}{n!}. $$Factorising
the $-1$'s, the above equals
$$ (-1)^n\frac{(x)(x + 1) \cdots (x + n - 1)}{n!}, $$ which is the same as
$$ (-1)^n \binom{x + n - 1}{n}.$$
\begin{exa} Prove that $$ \sum _{k \leq m} (-1)^k\binom{a}{k} = (-1)^m
\binom{a - 1}{m}, \hspace{7mm}m \in \BBN .$$
 \end{exa}
Solution: Using upper negation twice and the result from  example
(3.8) we find
$${\everymath{\displaystyle}\begin{array}{lcl}
\sum _{k \leq m} (-1)^m \binom{a}{m} & = & \sum _{k \leq m}
\binom{k - a
- 1}{k} \\
& = & \binom{-a + m}{m} \\
& = &  (-1)^m\binom{a - 1}{m},
\end{array}}$$as wanted.



Using Taylor's Theorem, we can prove a more general version of the
Binomial Theorem. For general $\alpha\in\BBR$ and $|x| < 1$, the
{\em Generalised Binomial Theorem} holds:
$$ (1 + x)^{\alpha} = \sum _{k = 0} ^\infty \binom{\alpha}{k}x^k .$$


Albeit we will not prove the Generalised Binomial Theorem here, we
will give an example of its use.


\begin{exa} Find the coefficient of $x^{1006}$ in the expansion of
$$\frac{x^{1000}}{(1 - 5x^2)^{10}}.$$ \end{exa}
Solution: By the Generalised Binomial Theorem
$$ \frac{x^{1000}}{(1 - 5x^2)^{10}} = \sum _{k = 0} ^\infty \binom{-10}{k}
(-5)^kx^{1000 + 2k}.$$Thus we need $k = 3$ and the coefficient
sought is
$$ (-5)^{3}\binom{-10}{3} = -125\frac{(-10)(-11)(-12)}{3!} = 27500.$$

\section{Formal Power Series}
We now study power series {\em formally}, that is, we do not worry
about questions of convergence. If we have two power series $$
A(x) = \sum _{n = 0} ^{\infty} a_n x^n \ {\rm and} \ B(x) = \sum
_{n = 0} ^{\infty} b_n x^n ,$$ their sum is given by $$ A(x) +
B(x) = \sum _{n = 0} ^\infty (a_n + b_n) x^n.$$Their product
$A(x)B(x)$ can be computed using the {\em Abel-Cauchy convolution
formula}:
$$ A(x)B(x) = \sum _{n = 0} ^\infty \left(\sum _{k = 0} ^n a_k b_{n - k}\right) x^n .$$
Some power series occur so often that the student will do well in
memorising them. The most common are
\begin{equation} \frac{1}{1 - x} = 1 + x + x^2 + x^3 + \cdots \label{eq:geometric_sum1}\end{equation}
\begin{equation} \frac{1}{1 + x} = 1 - x + x^2 - x^3 + \cdots \label{eq:geometric_sum2}\end{equation}
\begin{equation} \log \frac{1}{1 - x} = x + \frac{x^2}{2} + \frac{x^3}{3} \frac{x^4}{4} + \cdots\label{eq:log_sum1}\end{equation}
\begin{equation} \log (1 + x) = x - \frac{x^2}{2} + \frac{x^3}{3} + \frac{x^4}{4} + \frac{x^5}{5} + \cdots\label{eq:log_sum2}\end{equation}
\begin{equation} e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} + \cdots\label{eq:exp_sum}\end{equation}
\begin{equation}\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots \label{eq:sin_sum}\end{equation}
\begin{equation} \cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots \label{eq:cos_sum}\end{equation}


\begin{exa} Obtain \ref{eq:log_sum2} from \ref{eq:geometric_sum2}. \end{exa}
Solution: Integrating term by term
$$ \int _{0} ^y \frac{1}{1 + x} \ dx = \int _0 ^y (1  - x + x^2 - x^3 + x^4 -  \cdots ) \ dx,$$
whence
$$ \log (1 + y) = y - \frac{y^2}{2} + \frac{y^3}{3} - \frac{y^4}{4} + \frac{y^5}{5} - \cdots $$
\begin{exa} Obtain \ref{eq:cos_sum} from \ref{eq:sin_sum}.\end{exa}
Solution: Differentiating term by term
$$ \frac{d}{dx}\sin x = \frac{d}{dx} \ (x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots )$$
we obtain
 $$\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots,$$
as wanted.
\begin{exa} Find the power series expansion of $\arctan x.$\end{exa}
Solution: We have
$$ \frac{1}{1 + y^2} = 1 - y^2 + y^4 - y^6 + y^8 - \cdots$$
Integrating term by term
$$ \int _0 ^x \frac{dy}{1 + y^2} = \int _0 ^x (1 - y^2 + y^4 - y^6 + y^8 - \cdots) \ dx,$$
which is to say
$$ \arctan x = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots$$
\begin{exa}In the expansion of $$ (1 + x + x^2 + x^3 )^4 ,$$\begin{enumerate}
\item Find the coefficient of $x^6$. \item Find the coefficient of
$x^{24}$.\end{enumerate}\end{exa} Solution: (1) As $1 - x^4 = (1 -
x)(1 + x + x^2 + x^3 )$, we have
$$ (1 + x + x^2 + x^3)^4 = (1 - x^4)^4 (1 - x)^{-4}.$$From this, the exponent 6 can
be obtained in two ways: $x^0 x^6$ and $x^4 x^2$. Using the
Binomial Theorem (and generalised Binomial Theorem) we see that
the coefficient sought is
$$ \binom{4}{0}\binom{-4}{6} - \binom{4}{1}\binom{-4}{2}.$$
(2) The exponent 24 can be obtained from $(1 - x^4 )^4 (1 -
x)^{-4}$ in five ways: from $x^0 x^{24}, \ x^4 x^{20}, \ x^8
x^{16}, \ x^{12}x^{12},$ and from $x^{16}x^{8}.$ Using the
{Abel-Cauchy} convolution identity, the numerical value of this
coefficient is
 $$ \binom{4}{0}\binom{-4}{24} - \binom{4}{1}\binom{-4}{20} + \binom{4}{2}\binom{-4}{16} - \binom{4}{3}\binom{-4}{12} + \binom{4}{4}\binom{-4}{8}. $$
\begin{exa} Prove that for integer $n \geq 1,$ $$ \binom{2n}{n} = \sum _{k =
0} ^n \binom{n}{k}\binom{n}{n - k} .$$ \end{exa} Solution: The
strategy is to split $\binom{n}{k}\binom{n}{n - k}$ into
$\binom{n}{k}$ and $\binom{n}{n - k}$. By the Binomial Theorem,
$\binom{2n}{n}$ is the coefficient of $n$ is the expansion of $(1
+ x)^{2n}$. As $(1 + x)^{2n} = (1 + x)^{n} (1 + x)^{n}$, using the
Abel-Cauchy convolution, the coefficient of $x^n$ on the dextral
side is $\sum _{k = 0} ^n \binom{n}{k}\binom{n}{n - k}$, and so
the identity is established.
\begin{exa} Find a closed form for $$ \sum _{k \leq n} k \binom{n}{k} ^2.$$ \end{exa}
Solution: The strategy is to split $k\binom{n}{k} ^2 =
k\binom{n}{k}\binom{n}{n - k}$ into $k\binom{n}{k}$ and
$\binom{n}{n - k}$. Now, $k\binom{n}{k}$ occurs in the derivative
of $(1 + x)^n$, as
$$ nx(1 + x)^{n - 1} = \sum _{k \leq n} k\binom{n}{k} x^k.$$The term $\binom{n}{n - k}$ occurs,
of course, in the binomial expansion
$$ (1 + x)^n = \sum _{k \leq n} \binom{n}{n - k} x^{n - k}.$$If we multiply these two sums together
using the Abel-Cauchy convolution formula, the coefficient of
$x^n$ in the expansion of
$$ nx(1 + x)^{n - 1}(1 + x)^n$$ is $$\sum _{k \leq n} k\binom{n}{k}\binom{n}{n - k}.$$But this
coefficient, is the same as the coefficient of $x^n$ in the
expansion of
$$ nx(1 + x)^{2n - 1},$$that is, $n\binom{2n - 1}{n - 1}$. Therefore
$$ \sum _{k \leq n} k\binom{n}{k} ^2 = n\binom{2n - 1}{n - 1}.$$


Although we said that we were going to consider power series
formally, we mention
in passing the important {\em Abel's Limit Theorem.} \\
{\bf Abel's Limit Theorem:} Let $r > 0,$ and suppose that $\sum
_{n \geq 0} a_nr^n$ converges. Then $\sum _{n \geq 0}a_nx^n$
converges absolutely for $|x| < r$, and
$$  \lim _{x \rightarrow r^-}\ \sum _{n \geq 0} a_nx^n = \sum _{n \geq 0} a_nr^n.$$
Abel's Limit Theorem can also be extended to cover the case when
one is in a region of the complex plane.


\begin{exa} Find the exact numerical value of $$ \sum _{n \geq 1} \frac{(-1)^{n - 1}}{n}.$$ \end{exa}
Solution: This alternating series converges by Leibniz's Test.
Consider more generally
$$ f(x) = \sum _{n \geq 1} \frac{(-1)^{n - 1}x^n}{n} = \log (1 + x),$$by (3.4.4).
We see that $f(1) = \log 2.$ Thus
$$ 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots = \log 2,$$by Abel's Limit Theorem.
\begin{exa} Prove that $$ \frac{\pi}{4} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} - \cdots$$\end{exa}
Solution: The given alternating series converges by Leibniz's
Test. The result follows immediately from example (3.28) by
letting $x \rightarrow 1.$
\begin{exa} Find the exact numerical value of
$$ \sum _{n \geq 0} \frac{(n + 1)^2}{n!}.$$\end{exa}
Solution: Let
$$ f(x) = xe^x = \sum _{n \geq 0} \frac{x^{n + 1}}{n!}.$$Then
$$f'(x) = xe^x + e^x = \sum _{n \geq 0} \frac{(n + 1)x^n}{n!}.$$
Multiplying by $x,$
$$xf'(x) = x^2e^x + xe^x = \sum _{n \geq 0} \frac{(n + 1)x^{n + 1}}{n!}.$$
Differentiating this last equality,
$$xf''(x) + f'(x) = 2xe^x + x^2e^x + xe^x + e^x = \sum _{n \geq 0} \frac{(n + 1)^2x^n}{n!}.$$
Letting $x \rightarrow 1,$ we obtain
$$ \sum _{n \geq 0} \frac{(n + 1)^2}{n!} = 2e + e + e + e = 5e.$$



\section{Series Multisection}
In what follows we will need {\em DeMoivre's Theorem}: if $n$ is a
natural number, then $$(\cos x + i\sin x)^n  = \cos xn + i\sin
xn.$$ Consider the polynomial $$ 1 - x^n = (1 - x)(1 + x + x^2 +
\cdots + x^{n - 1}).$$ Its $n$ roots $\epsilon _k , k = 0, 1, 2,
\ldots , n - 1$ are the $n$th roots of unity
$$ \epsilon _k = \cos \frac{2\pi k}{n} + i\sin \frac{2\pi k}{n} = e^{2\pi ik/n}, \ k = 0, 1, \ldots , n - 1.$$
For example, the roots of $x^3 - 1 = 0$ are $\cos \frac{2\pi\cdot
0}{3} + i\sin \frac{2\pi\cdot 0}{3} = 1, \cos \frac{2\pi\cdot 1
}{3} + i\sin \frac{2\pi \cdot 1}{3} = -1/2 + i\sqrt{3}/2, $ and
$\cos \frac{2\pi\cdot 2 }{3} + i\sin \frac{2\pi \cdot 2}{3} = -1/2
- i\sqrt{3}/2.$ Suppose that $\epsilon ^n = 1$ but $\epsilon \neq
1.$ Then
$$ 1 + \epsilon + \epsilon ^2 + \epsilon ^3 + \cdots + \epsilon ^{n - 1} = \frac{\epsilon ^n - 1}{\epsilon - 1} = 0.$$
Hence
$$ 1 + x + x^2 + \cdots + x^{n - 1} = \left\{\begin{array}{ll} 0 & x = \cos \frac{2\pi k}{n} + i\sin \frac{2\pi k}{n} 1 \leq k
\leq n - 1 \\
n & x = 1.  \end{array} \right.$$






The above identity is quite useful for ``multisecting'' a power
series. For example, suppose we wanted to find the sum of every
third term of $\sum _{k = 0} ^{27} \binom{27}{k}$, starting with
the first one, that is, $S = \sum _{k = 0} ^{9} \binom{27}{3k}$.
Then we use the fact that for $\epsilon _1 = -1/2 + i\sqrt{3}/2$
and $\epsilon _2 = -1/2 - i\sqrt{3}/2$ we have $$ \epsilon _k ^3 =
1, \ {\rm and} \ 1 + \epsilon _k + \epsilon _k ^2 = 0, \ k = 1,
2.$$ Thus $$ (*) \hspace{7mm}  \epsilon _k ^{s} + \epsilon _k ^{s
+ 1} + \epsilon _k ^{s + 2} = 0, \ k = 1, 2, \ s\in \BBZ. $$ From
this
$${\everymath{\displaystyle} \begin{array}{lcl} (1 + 1)^{27} & = & \binom{27}{0} + \binom{27}{1} + \binom{27}{2} + \binom{27}{4} + \cdots +
\binom{27}{26} + \binom{27}{27} \\
(1 + \epsilon _1)^{27} & = & \binom{27}{0} + \binom{27}{1}\epsilon
_1 + \binom{27}{2}\epsilon _1 ^2 +
\binom{27}{3}\epsilon _1 ^3 + \cdots + \binom{27}{27}\epsilon _1 ^{27} \\
(1 + \epsilon _2)^{27} & = & \binom{27}{0} + \binom{27}{1}\epsilon
_2 + \binom{27}{2}\epsilon _2 ^2 + \binom{27}{3}\epsilon _2 ^3 +
\cdots + \binom{27}{27}\epsilon _2 ^{27}
\end{array}}$$ Summing column-wise and noticing that because of $(*)$ only the terms $0, 3, 6, \ldots , 27$ survive,
$$ 2^{27} + (1 + \epsilon _1)^{27} + (1 + \epsilon _2)^{27} = 3\binom{27}{0} + 3\binom{27}{3} + 3\binom{27}{6} +
\cdots + 3\binom{27}{27}. $$ By DeMoivre's Theorem, $(1 - 1/2 +
i\sqrt{3}/2)^{27} = \cos 9\pi + i\sin 9\pi = -1$ and $(1 - 1/2 -
i\sqrt{3}/2)^{27} = \cos 45\pi + i\sin 45\pi = -1$. Thus
$$ \binom{27}{0} + \binom{27}{3} + \binom{27}{6} + \cdots + \binom{27}{27} = \frac{1}{3}(2^{27} - 2).$$



The above procedure can be generalised as follows. Suppose that
$$ f(x) = \sum _{k = 0} ^\infty \ c_kx^k.$$ If $\omega = e^{2\pi i/q,}, q \in \BBN , q > 1,$ then
$\omega ^q = 1$ and $1 + \omega + \omega ^2 + \omega ^3 + \cdots +
\omega ^{q - 1} = 0.$ Then in view of
$$  \frac{1}{q}\sum _{1 \leq b \leq q} \omega ^{kb} = \left\{\begin{array}{ll}
1 & {\rm if \ } q \ {\rm divides \ } k, \\
0 & {\rm else},
\end{array} \right.$$
we have \begin{equation} \sum _{\stackrel{n = 0}{n \equiv a \ {\rm
mod} \ q}} ^\infty  c_{n}x^n = \frac{1}{q}\sum _{b = 1} ^q \omega
^{-ab}f( \omega ^b x).\end{equation} We may use complex numbers to
select certain sums of coefficients of polynomials. The following
problems use the fact that if $k$ is an integer
\begin{equation}
i^k + i^{k + 1} + i^{k + 2} + i^{k + 3} = i^k(1 + i + i^2 + i^3) =
0 \end{equation}


\begin{exa} Find the sum of all the coefficients once the following product is expanded
and like terms are collected:
$$(1 - x^2 + x^4)^{109}(2 - 6x + 5x^9)^{1996}.$$  \end{exa}
Solution: Put
$$ p(x) = (1 - x^2 + x^4)^{109}(2 - 6x + 5x^9)^{1996}.$$Observe that  $p(x)$
is a polynomial of degree $4\cdot 109 + 9\cdot 1996 = 18400.$ Thus
$p(x)$ has the form

$$p(x) = a_0 + a_1x + a_2x^2 + \cdots + a_{18400}x^{18400}.$$The sum of all the coefficients of
$p(x)$ is
$$p(1) = a_0 + a_1 + a_2 + \cdots + a_{18400},$$which is also
$p(1) = (1 - 1^2 + 1^4)^{109}(2 - 6 + 5)^{1996} = 1.$ The desired
sum is thus $1$.


\begin{exa} Let
$$(1 + x^4 + x^8)^{100} = a_0 + a_1x + a_2x^2 + \cdots + a_{800}x^{800}.$$
Find: \begin{dingautolist}{202}
\item $a_0 + a_1 + a_2 + a_3 + \cdots + a_{800}.$ \\
\item $a_0 + a_2 +  a_4 + a_6 + \cdots + a_{800}.$  \\
\item $a_1 + a_3 +  a_5 + a_7 + \cdots + a_{799}.$   \\
\item $a_0 + a_4 +  a_8 + a_{12} + \cdots + a_{800}.$ \\
\item $a_1 + a_5 +  a_9 + a_{13} + \cdots + a_{797}.$
\end{dingautolist}
\end{exa}
Solution: Put $$p(x) = (1 + x^4 + x^8)^{100} = a_0 + a_1x + a_2x^2
+ \cdots + a_{800}x^{800}.$$ Then \begin{dingautolist}{202} \item
$$ a_0 + a_1 + a_2 + a_3 + \cdots + a_{800} = p(1) = 3^{100}.
$$ \item $$a_0 + a_2 +  a_4 + a_6 + \cdots + a_{800} = \frac{p(1) +
p(-1)}{2} = 3^{100}. $$ \item $$a_1 + a_3 +  a_5 + a_7 + \cdots +
a_{799} = \frac{p(1) - p(-1)}{2} = 0. $$ \item $$a_0 + a_4 +  a_8
+ a_{12} + \cdots + a_{800} = \frac{p(1) + p(-1) + p(i) +
p(-i)}{4} = 2\cdot 3^{100}.$$ \item
$$a_1 + a_5 +  a_9 + a_{13} + \cdots + a_{797} = \frac{p(1) - p(-1) -ip(i) + ip(-i)}{4} =
0.$$
\end{dingautolist}
\begin{exa} Let $$ (1 + x + x^2)^n = a_0 + a_1 x + a_2 x^2 + \cdots + a_{2n} x^{2n}. $$
Find formul\ae \,\,  for \begin{enumerate} \item
$\displaystyle{\sum _{k = 0} ^{2n} a_k}$ \item $\displaystyle{\sum
_{0 \leq k \leq n/2} a_{2k}}$ \item $\displaystyle{\sum _{1 \leq k
\leq n/2} a_{2k - 1}}$ \item $a_0 + a_4 + a_8 + \cdots$ \item $a_1
+ a_5 + a_9 + \cdots$
\end{enumerate} \end{exa}
Solution: Let $f(x) = (1 + x + x^2)^n$. \\
(1) Clearly $a_0 + a_1 + a_2 + a_3 + a_4 + \cdots = f(1) = 3^n.$ \\
(2) We have $$ \begin{array}{lcl} f(1) & = &  a_0 + a_1 + a_2 + a_3 + \cdots \\
f(-1) & = & a_0 - a_1 + a_2 - a_3 + \cdots \\ \end{array}$$
Summing these two rows,
$$ f(1) + f(-1) = 2a_0 + 2a_2 + 2a_4 + \cdots ,$$
whence
$$ a_0 + a_2 + a_4 + \cdots = \frac{1}{2}(f(1) + f(-1)) = \frac{1}{2}(3^n + 1).$$
(3) We see that $$ f(1) - f(-1) = 2a_1 + 2a_3 + 2a_5 + \cdots$$
Therefore
$$ a_1 + a_3 + a_5 + \cdots = \frac{1}{2}(f(1) - f(-1)) = \frac{1}{2}(3^n - 1).$$
(4) Since we want the sum of every fourth term, we consider the
fourth roots of unity, that is, the complex numbers with $x^4 =
1.$ These are $\pm 1, \pm i.$ Now consider the equalities
$$\begin{array}{lcl}
f(1)   & = & a_0 + a_1  + a_2 + a_3 + a_4 + a_5 + a_6 + a_7 + a_8 + a_9 + \cdots \\
f(-1) & = & a_0 - a_1 + a_2 - a_3 + a_4 - a_5 + a_6 - a_7 + a_8 - a_9 + \cdots \\
f(i)  & = & a_0 + ia_1  - a_2  -  ia_3 + a_4 + ia_5 - a_6 - ia_7 + a_8 + ia_9 + \cdots \\
f(-i) & = & a_0 - ia_1  - a_2  +  ia_3 + a_4 - ia_5 - a_6 + ia_7 + a_8 - ia_9 + \cdots \\
\end{array}$$
Summing these four rows,
$$ f(1) + f(-1) + f(i) + f(-i) = 4a_0 + 4a_4 + 4a_8 + \cdots ,$$whence
$$a_0 + a_4 + a_8 + \cdots = \frac{1}{4}(f(1) + f(-1) + f(i) + f(-i)) = \frac{1}{4}(3^n + 1 + i^n + (-i)^n).$$
(5) Consider the equalities
$$\begin{array}{lcl}
f(1)   & = & a_0 + a_1  + a_2 + a_3 + a_4 + a_5 + a_6 + a_7 + a_8 + \cdots \\
-f(-1) & = & - a_0 + a_1 - a_2 + a_3 - a_4 + a_5 - a_6 + a_7 - a_8 +  \cdots \\
-if(i)  & = & -ia_0 + a_1  + ia_2  -  a_3 - ia_4  + a_5 + ia_6 - a_7  - ia_8 + \cdots \\
if(-i) & = & ia_0 + a_1  - ia_2  - a_3 + ia_4  + a_5 - ia_6  - a_7 + ia_8  +  \cdots \\
\end{array}$$
Adding
$$ f(1) - f(-1) - if(i) + if(i) = 4a_1 + 4a_5 + 4a_9 + \cdots , $$whence
$$ a_1 + a_5 + a_9 + \cdots  = \frac{1}{4}\left( 3^n - 1 - i^{n + 1}  - (-i)^{n + 1}\right) .$$
\begin{exa} Find the exact numerical value of $$ \sum _{k = 0} ^{665} \binom{1995}{3k}.$$
\end{exa}
Solution: Since we want every third term starting with the zeroth
one, we consider the cube roots of unity, that is, $\omega ^3 =
1$. These are $\omega = -1/2 - \sqrt{3}/2, \omega ^2 = -1/2 +
\sqrt{3}/2$ and $\omega ^3 = 1.$ If $\omega \neq 1,$ then $1 +
\omega + \omega ^2 = 0.$ If $\omega = 1, 1 + \omega + \omega ^2 =
3.$ Thus if $k$ is not a multiple of 3, $1^k + \omega ^k + \omega
^{2k} = 0,$ and if $k$ is a multiple of 3, then $1^k + \omega ^k +
\omega ^{2k} = 3.$ By the Binomial Theorem we then have
$$ {\everymath{\displaystyle}\begin{array}{lcl}(1 + 1)^{1995} + (1 + \omega)^{1995}  & & \\
\quad +  (1 + \omega ^2)^{1995} & = &
\sum _{k \leq 1995} (1^k + \omega ^k + \omega ^{2k})\binom{1995}{k} \\
& = & \sum _{k \leq 665} 3\binom{1995}{3k}.
\end{array}}$$But $(1 + \omega)^{1995} = (-\omega ^2)^{1995} = -1,$ and $(1 + \omega ^2)^{1995}
= (-w)^{1995} = - 1$. Hence $$ \sum _{k \leq 665} \binom{1995}{3k}
= \frac{1}{3}(2^{1995} - 2).$$

\section{Miscellaneous examples}
\begin{exa} Shew that the series obtained from the harmonic series by
deleting all the terms that contain at least one 0 converges.
\end{exa} Solution: Let ${\cal S}$ be the set of integers that do
not have any $0$ in their decimal representation. Take any $n \in
{\cal S}$ with $k$ digits. Then $n \geq 10^{k - 1}$ and there are
$9^k$ possible $n$. Therefore, the series satisfies
 \begin{eqnarray*}\sum _{n \in {\cal S}} \frac{1}{n} & = &  \sum _{k = 1} ^{\infty}\,\, \sum _{ \stackrel{10^{k - 1} \leq n < 10^k}{n\in {\cal S}}} \frac{1}{n} \\
& \leq & \sum _{k = 1} ^\infty \frac{9^k}{10^{k - 1}} \\ & = & 90.
\end{eqnarray*} Hence the sum is majorised by a converging
geometric series and its sum is at most $90$.


\begin{exa} Let  $\alpha (n)$ denote the number of zeroes that $n$ has, for
example $\alpha (660006) = 3$. For $N \in \BBN$, evaluate $$ L =
\lim _{N \rightarrow \infty} \quad \frac{\ln S(N)}{\ln N}$$where
$$ S(N) = \sum _{n = 1} ^N 666^{\alpha (n)}. $$\end{exa}
Solution: Suppose $n$ has $k$ digits, i.e. $10^{k - 1} \leq n <
10^k$. Let us count how many $k$-digit numbers have exactly $j, 0
\leq j \leq k - 1$ digits. We can choose the first digit from the
left in $9$ distinct ways (it cannot be $0$). Of the remaining $k
- 1$ slots, we can choose $j$ of them to contain the $j$ 0's in
$\binom{k - 1}{j}$ ways. The remaining $k - 1 - j$ can be filled
in $9^{k - 1 - j}$ ways (they cannot be $0$). Thus, there are
$9^{k - j}\binom{k - 1}{j} k$-digit numbers having exactly $j$
0's. Therefore
\begin{eqnarray*} \sum _{n = 1} ^N 666^{\alpha (n)} & = & \sum _{1 \leq k \leq \log _{10} N} \sum _{10^{k - 1} \leq n < 10^k}  666^{\alpha (n)} \\
& = & \sum _{1 \leq k \leq \log _{10} N}\,\, \sum _{0 \leq j \leq k - 1} \,\,\sum _{\stackrel{10^{k - 1} \leq n < 10^k}{\alpha (n) = j}} 666^{\alpha (n)} \\
& = & \sum _{1 \leq k \leq \log _{10} N} \,\, \sum _{0 \leq j \leq k - 1} 9^{k - j} \binom{k - 1}{j}666^j    \\
& = & \sum _{1 \leq k \leq \log _{10} N} 9(666 + 9)^{k - 1} \\
& = & 9\frac{675^{[\log _{10} N] + 1} - 1}{674}.
\end{eqnarray*}
So $$ \ln S(N) \sim [ \log _{10} N] \ln 675,$$ whence $$ L = \log
_{10} 675.$$
\section*{Homework}\addcontentsline{toc}{section}{Homework}\markright{Homework}
\begin{pro} Find the ordinary generating functions for the following sequences.
\begin{enumerate}
\item $a_n = 1, n = 0, 1, 2, \ldots$ \item $a_n = n, n = 0, 1, 2,
\ldots $ \item $a_n = n^2, n = 0, 1, 2, \ldots$ \item $a_n = 1/n!,
n = 0, 1, 2, \ldots$ \item $a_n = 1/(2n)!$ if $n \geq 0$ is even
and $a_n = 0$ if $n \geq 1$ is odd. \item $a_n = 1/(3n)!$ if n is
a multiple of $3$ and $a_n = 0$ otherwise.
\end{enumerate} \end{pro}
\begin{pro} Find the generating function of the sequence of the central binomial
coefficients$$ \binom{2n}{n},  \qquad n \geq 0.$$\end{pro}
\begin{pro} Let $n$ be a positive integer. What is the ordinary generating function
for the binomial coefficients $$ \binom{n}{k}, \quad  0 \leq k
\leq n ?$$\end{pro}
\begin{pro} A sequence $a_0 = 1, a_1, a_2, \ldots$ satisfies
$$ \sum _{k \leq n} a_ka_{n - k} = 1$$ for every $n \geq 1.$ Find its generating function.\end{pro}
\begin{pro} Let k be a fixed positive integer. Prove that
$$ \sum _{\stackrel{a_1 + a_2 + \cdots + a_k = n}{a_j \in \BBN}} a_1a_2\cdots a_k = \frac{n(n^2 - 1^2)\cdots (n^2 - (k - 1)^2)}{(2k - 1)!}$$\end{pro}
(Hint: Prove that the ordinary generating function of the
sinistral side is $ \frac{x^k}{(1 - x)^{2k}} .) $


\begin{pro} Find the generating function for the number of selections of $r$ distinct
integers from $\{ 1, 2, \ldots , n\}$ such that $|x - y| > 2$ for
all $x, y$ selected.\end{pro}
\begin{pro} Find the ordinary generating function for the number of ways of putting
$k$ identical balls in $n$ different boxes such that, no box
contains more than one ball, and no two empty boxes are
adjacent.\end{pro}
\begin{pro}  Find the generating function for the number of ways of choosing r distinct integers
from $\{ 1, 2, \ldots , n\}$ no two of them consecutive.\end{pro}
\begin{pro} Find the ordinary generating function for the number of ways a roll of
n distinct dice will produce a sum of $r$.\end{pro}


\begin{pro} Use induction to prove the {\em Factorial Binomial Theorem}
$$ (x + y)^{(n)}  = \sum _{k = 0} ^n \binom{n}{k} x^{(k)}y^{(n - k)}, \
n\in\BBN .$$ \end{pro}
\begin{pro} Find the value of $$ \frac{1}{3 + \Delta}  \ k^{(2)}.$$ \end{pro}
(Hint: $\frac{1}{3 + \Delta} = \frac{1/3}{1 + \Delta /3}$.)

\begin{pro} Prove that $$ \sum _{k = 1} ^n k = \frac{n(n + 1)}{2}$$using
finite differences. \end{pro}
\begin{pro} Prove that $$ \sum _{k = 1} ^n k^3 = \frac{n^2 (n +
1)^2}{4},$$and thus $$(1 + 2 + 3 + \cdots + n)^2 = 1^3 + 2^3 +
\cdots + n^3 .$$ \end{pro}
\begin{pro} Assuming that $\sum _{k = 0} ^\infty x^k = \frac{1}{1 - x}$ for
$|x| < 1,$ find the exact numerical value of $$ \sum _{n = 1}
^\infty \frac{n}{2^n},$$
$$ \sum _{n = 2} ^\infty \frac{n(n - 1)}{3^n},$$and
$$ \sum _{n = 1} ^\infty \frac{1}{(n + 1)3^n}.$$ \end{pro}
\begin{pro} Prove that $$ \sum _{k = 1} ^n k(k + 1)(k + 2) = \frac{(n +
3)(n + 2)(n + 1)(n)}{4}.$$ \end{pro}
\begin{pro} Find a closed form for
$$ \sum _{k \leq n} \frac{1}{(k + 1)(k + 2)(k + 3)(k + 4)}$$\end{pro}

\begin{pro}[AIME 1994] The function $f$ has the property that, for
each real number
$$ f(x) + f(x - 1) = x^2 .$$If $f(19) = 94,$ what is the remainder when $f(94)$ is
divided by $1000$?
\begin{answer6} $561$\end{answer6}
\end{pro}
\begin{pro} Find the solution to the recursion $$ a_n = na_{n - 1}, \ n >
1, \ a_1 = 343.$$
\end{pro}
\begin{pro}[Putnam 1969] The terms of a sequence $T_n$ satisfy
$$ T_nT_{n + 1} = n \ \ \ (n = 1, 2, 3, \cdots ) $$ and $$\lim
_{n \rightarrow \infty} \frac{T_n}{T_{n + 1}} = 1.$$ Shew that
$\pi T_{1}^{2} = 2.$\end{pro}
\begin{pro}[AHSME 1992] The increasing sequence of positive integers
$a_1, a_2, a_3, \cdots $ has the property that $a_{n + 2} = a_n +
a_{n + 1}$ for all $n \geq 1.$ If $a_7 = 120,$ the $a_8$ is what
number?
\begin{answer6} $194$\end{answer6}
\end{pro}
\begin{pro}[AHSME 1992] For a finite sequence $$A = (a_1, a_2, a_3,
\cdots, a_n)$$ of numbers, the {\em Ces\`{a}ro sum} of $A$ is
defined to be
$$ \frac{S_1 + S_2 + S_3 + \cdots + S_n}{n},$$
where $S_k = a_1 + a_2 + a_3 + \cdots + a_k (1 \leq k \leq n).$ If
the Ces\`{a}ro sum of the $99$-term sequence $(a_1, a_2, a_3,
\cdots, a_{99})$ is $1000$, what is the Ces\`{a}ro sum of the
$100$-term sequence $(1, a_1, a_2, a_3, \cdots, a_{99})$?
\begin{answer6} $991$\end{answer6}
\end{pro}
\begin{pro}[AHSME 1993] Consider the non-decreasing sequence of
positive integers $$ 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5,
\cdots$$ in which the $n$-th positive integer appears $n$ times.
The remainder when the $1993$-th term is divided by $5$ is what
number?
\begin{answer6} $3$\end{answer6}
\end{pro}
\begin{pro}[AHSME 1993] Let $a_1, a_2, a_3, \cdots a_k$ be a finite
arithmetic sequence with $a_4 + a_7 + a_{10} = 17$ and $a_4 + a_5
+ a_6 + \cdots + a_{14} = 77.$ If $a_k = 13$, then $k = ?$
\begin{answer6} $18$\end{answer6}
\end{pro}
\begin{pro}[AHSME 1994]In the sequence
$$\cdots, a, b, c, d, 0, 1, 1, 2, 3, 5, 8, \cdots$$
each term is the sum of the two terms to its left.  Find $a$.
\begin{answer6} $-3$\end{answer6}
\end{pro}

\begin{pro}[AHSME 1994] Find the sum of the arithmetic series
$$ 20 + 20\frac{1}{5} + 20\frac{2}{5} + \cdots + 40.$$
\begin{answer6} $3030$\end{answer6}
\end{pro}

\begin{pro}[Putnam 1948] Let $a_n$ be a decreasing sequence of
positive numbers with limit 0 such that $b_n = a_n - 2a_{n + 1} +
a_{n + 2} \geq 0$ for all $n$. Prove that
$$\sum _{n = 1} ^{\infty} nb_n = a_1.$$ \end{pro}
\begin{pro}[Putnam 1952] Let $a_j(j = 1, 2, \cdots, n)$ be arbitrary
numbers.  Prove that
$$ a_1 + \sum _{i = 2} ^n a_i \prod _{j = 1} ^{i - 1} (1 - a_j) = 1 -
\prod _{j = 1} ^n (1 - a_j).$$ \end{pro}


\begin{pro} Prove that $$ \sum _{k \geq 0} \binom{n + k}{2k}\binom{2k}{k}(-1)^k = \frac{\binom{0}{n}}{n + 1}$$
for nonnegative integer $n$.\end{pro}
\begin{pro}Prove that $$ \sum _{k \geq 0} \binom{n + k}{n + 2k} \binom{2k}{k} \frac{(-1)^k}{k + 1} = \binom{n - 1}{m - 1},$$for
natural numbers $n$ and $m$. \end{pro}
\begin{pro} Prove that
$$ (1 - 4x)^{-1/2} = \sum _{n \geq 0} \binom{2n}{n} x^n.$$\end{pro}
\begin{pro} Simplify $$ \sum _{n \geq 0} \binom{2n - 1}{n} x^n.$$ \end{pro}
\begin{pro} Find the coefficient of $x^9$ in the expansion of
$$ \frac{x}{1 + x^2 + x^4}.$$\end{pro}

\begin{pro} Prove that $$ \frac{1}{(1 - x)^{k + 1}} = \sum _{n \geq 0} \binom{n + k}{n} x^n.$$ \end{pro}
(Hint: Use the Generalised Binomial Theorem).
\begin{pro} Prove that $$ \arcsin x = x + \frac{1}{2}\cdot\frac{x^3}{3} + \frac{1\cdot 3}{2\cdot 4}\frac{x^5}{5} + \frac{1\cdot 3\cdot 5}{2\cdot 4\cdot 6}\frac{x^7}{7} + \cdots$$ \end{pro}
(Hint: Use the Generalised Binomial Theorem to expand
$\frac{1}{\sqrt{1 - x^2}}$)
\begin{pro} Find a closed form for $$ \sum _{k \geq 0} kx^k.$$\end{pro}
\begin{pro} Find the exact numerical value of $$ \sum _{k \geq 0} \frac{k}{2^k}.$$ \end{pro}
\begin{pro}  Find a closed form for $$\sum _{k \geq 0} k^2x^k.$$\end{pro}
\begin{pro} Find the exact numerical value of $$\sum _{k \geq 0} \frac{k^2}{2^k}.$$\end{pro}
\begin{pro} Prove that $$ \sum _{k \leq n} \binom{2k}{k}\binom{2n - 2k}{n
- k} = 4^n.$$ \end{pro}
\begin{pro} Prove that $$ 1 - \frac{1}{4} + \frac{1}{7} - \frac{1}{10} + \cdots = \frac{1}{3}\left( \log 2 + \frac{\pi}{\sqrt{3}}\right).$$ \end{pro}
(Hint: Expand $(1 + x^3)^{-1}$) into a power series. Integrate $(1
+ x^3)^{-1}$ using partial fractions. Use Abel's Limit Theorem.)
\begin{pro} Prove that $$ \sum _{k \leq n} \frac{\binom{n}{k + 1}}{\binom{n}{k}} = \frac{n(n + 1)}{2}.$$ \end{pro}
\begin{pro} Let $f(x) = 1 + x + x^2 + \cdots + x^{n}$. Find a closed formula for
$$ \sum _{k \leq n} k^2$$ by considering
$$\lim _{x\rightarrow 1^-} \frac{d}{dx}(x\frac{d}{dx}f(x)).$$ \end{pro}
\begin{pro}Prove that $$ \sum _{k \leq n} \frac{2^{k + 1}}{k + 1}\binom{n}{k} = \frac{3^{n + 1} - 1}{n + 1}.$$ \end{pro}
\begin{pro}Prove that $$ \sum _{k \leq n} \binom{n}{k}\binom{n}{r + k} = \frac{(2n)!}{(n - r)!(n + r)!}.$$ \end{pro}
\begin{pro}Prove that $$ \sum _{k \leq n} (2k + 1)\binom{n}{k} = 2^n(n + 1).$$ \end{pro}
\begin{pro} Prove that $$ \sum _{n \geq 1} ^\infty \frac{\sin n}{n} = \frac{\pi - 1}{2}.$$ \end{pro}
(Hint: Expand $\log (1 - e^i)$ and consider real and imaginary
parts. Use Abel's Limit Theorem.)

\begin{pro}[AHSME 1989] Find $$ \sum _{k = 0} ^{49} (-1)^k \binom{99}{2k}.$$
\end{pro}
\begin{pro}
Let
$$(1 + x^2 + x^4)^{100} = a_0 + a_1x + \cdots + a_{400}x^{400}.$$
Find
$$a_0 + a_3 + a_6 + \cdots + a_{399}.$$
\end{pro}

\begin{pro} Find the exact numerical value of $$ \sum _{k = 0} ^{664} \binom{1995}{3k + 1}.$$
\end{pro}
\begin{pro} Find a closed form for $$ \sum _{n \geq 0} \frac{x^{3n}}{(3n)!}$$\end{pro}
\begin{pro} Find a closed form for $$ \sum _{n \geq 0} \frac{x^{3n + 1}}{(3n + 1)!}.$$ \end{pro}
\begin{pro} For a set with one hundred elements, how many subsets are there whose
cardinality is a multiple of $3$?\end{pro}
\begin{pro} Prove that $$ \sum _{ 1 \leq k \leq n/2} (-1)^{k + 1}\binom{n}{2k - 1} = 2^{n/2}\sin \frac{n\pi}{4}$$
and
$$ \sum _{ 0 \leq k \leq n/2} (-1)^{k + 1}\binom{n}{2k} = 2^{n/2}\cos \frac{n\pi}{4}.$$
\end{pro}
\Closesolutionfile{discans}
\section*{Answers}\addcontentsline{toc}{section}{Answers}\markright{Answers}
{\small\input{discansC6}}





\end{document}
