series 0, 6, 13, 20, 27

88 Views Asked by At

I'm working with days of the week and need to generate a series thats $n*7-1$ except for where $n=1$ where it should be $0$.

So the series I'm after is $0,6,13,20,27$

I can't figure out a formula for this series though!

Any help would be appreciated!

Many thanks

2

There are 2 best solutions below

0
On

You probably won't get (and probably don't really need) a single "formula". This will work in any document, or computer program, or spreadsheet:

$$f(n) = \begin{cases} 7n -1 & n \ne 0 \\ 0 & n= 0 \end{cases} $$

0
On

Using the Kronecker delta:

$a_n=7n-1+\delta_{0,n}$

Note we start with $n=0$.