I have an `int N`

and a `vector[N] p`

and I’d like to compute

\sum_{i=1}^{N} i p_i.

I can do this in a loop:

```
real s = 0;
for(i in 1:N)
s += i*p[i];
```

Is there a way to do this without a loop? I tried this:

```
s = dot_product(1:N, p);
```

but I learned that 1:N means something different in Stan and in R, so this can’t work.