# Generating function $3^n + 7^n$ for $n \in \mathbb{N}_0$

Let $$a_n = 3^n +7^n$$ for $$n \in \mathbb{N}_0$$

How can one calculate the generating function of the sequence $$(a_n)_{n\in \mathbb{N}}$$?

Is that correct? If yes, how can one find that out?

In our Script $$A(x) = \sum_{n=0}^{\infty} a_nx^n$$ is a Power series and the generating function of the sequence $$(a_n)_{n\in \mathbb{N}}$$.

Equality, sum and product of two formal power series are defined as follows: Can someone also tell me how one can calculate the exponential generating function:

$$A(x) = \sum_{n=0}^{\infty}\frac{a_n}{n!}x^n$$

For example, if $$F(x) = \sum_{n=0}^{\infty} f_nx^n$$ is the generating function of Fibonacci numbers, then $$F(x) = \frac{x}{1-x-x^2}$$ and

$$f_n = \frac{1}{\sqrt5} ((\frac{1+\sqrt5}{2})^n - (\frac{1-\sqrt5}{2})^n)$$

• I thought the g.f. would be $\sum_{n=0}^\infty(3^n+7^n)x^n$.... – Lord Shark the Unknown Feb 7 at 22:51
• It may be worth linking to your definition of generating functions, as there's more than one kind. – J.G. Feb 7 at 22:54
• The series returned by Wolfram Alpha is just writing $3^n = e^{n\log 3}$ and using the Maclaurin series $e^x = \sum_{v \geq 0} \frac{x^v}{v!}$, so that's probably not what you want. – Riley Feb 7 at 22:58
• I think the main confusion in this post is the difference between a generating function and a power series expansion of the $n$th term. – jmacmanus Feb 7 at 23:04
• Because $\sum\limits_{n=0} x^n = \frac{1}{1-x}$ then $$f(x)=\sum\limits_{n=0}a_nx^n=\sum\limits_{n=0}\left(3^n+7^n\right)x^n= \sum\limits_{n=0}(3x)^n+\sum\limits_{n=0}(7x)^n=\frac{1}{1-3x}+\frac{1}{1-7x}$$ – rtybase Feb 7 at 23:07

## 2 Answers

Wolfram Alpha gave an expression for $$a_n$$, but you want $$\sum_{n\ge 0}a_n x^n$$, which is a sum of two geometric series. For $$|x|<\frac{1}{7}$$, it converges to $$\frac{1}{1-3x}+\frac{1}{1-7x}$$.

Under your definitions, we would have $$A(x) = \sum_{k \geq 0} (3^k + 7^k) x^k = \sum_{k \geq 0} (3x)^k + \sum_{k \geq 0} (7x)^k = \frac{1}{1 - 3x} + \frac{1}{1 - 7x}.$$ What exactly this means depends on what you mean by "generating function." If you mean an actual power series, then this is an analytic function defined for $$|x| < 1/7$$. If you mean a formal power series, then it's just a nice way to write the sum.