OFFSET
0,2
COMMENTS
a(n) is the sum of all (j+1)-th products of (n-j) successive primes for j=0..n: a(3) = 2*3*5 + 3*5 + 5 + 1 = ((1*2 + 1)*3 + 1)*5 + 1 = 51.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..350
FORMULA
MAPLE
a:= proc(n) option remember;
`if`(n=0, 1, 1+a(n-1)*ithprime(n))
end:
seq(a(n), n=0..23);
MATHEMATICA
Nest[Append[#1, 1 + #1[[-1]] Prime[#2]] & @@ {#, Length@ #} &, {1}, 19] (* Michael De Vlieger, Jan 22 2022 *)
nxt[{n_, a_}]:={n+1, a Prime[n+1]+1}; NestList[nxt, {0, 1}, 20][[;; , 2]] (* Harvey P. Dale, Jul 30 2023 *)
PROG
(PARI) a(n) = if (n, 1 + a(n-1)*prime(n), 1); \\ Michel Marcus, Jan 22 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 21 2022
STATUS
approved