I am **totally** new to Lisp.

How to find the difference between elements in an arithmetic progression series?

e.g.

```
(counted-by-N '(20 10 0))

```

Return `-10`

```
(counted-by-N '(20 10 5))
(counted-by-N '(2))
(counted-by-N '())

```

Returns `Nil`

In Python/C and other languages, it is very straightforward... Kinda stuck here in Lisp.

My pseudo algorithm would be something like this:

```
function counted-by-N(L):
    if len(L) <= 1:
        return Nil
    else:
        diff = L[second] - L[first]
        for (i = second; i < len(L) - 1; i++):
            if L[i+1] - L[i] != diff
                return Nil
        return diff

```

---

Current work:

```
(defun count-by-N (L)
    (if (<= (length L) 1) Nil
    (
        (defvar diff (- (second L) (first L)))
        ; How to do the loop part?
    ))
)

```