OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..350
FORMULA
a(n) = (a(n-1)+prime(n))*prime(n), a(1)=1.
a(n) = product(j=2..n, prime(j)) + sum(k=2..n, prime(k)*product(j=k..n, prime(j))). - Robert Israel, Feb 12 2015
EXAMPLE
n=4: a(4)=(a(3)+7)*7=(85+7)*7=644.
MAPLE
a:= n -> mul(ithprime(j), j=2..n) + add(ithprime(k)*mul(ithprime(j), j=k..n), k=2..n):
seq(a(n), n=1..30); # Robert Israel, Feb 12 2015
MATHEMATICA
f[x_]:=(f[x-1]+Prime[x])*Prime[x]; f[1]=0; Table[f[w], {w, 1, 25}]
nxt[{n_, a_}]:=Module[{p=Prime[n+1]}, {n+1, p(a+p)}]; NestList[nxt, {1, 1}, 20][[All, 2]] (* Harvey P. Dale, Jun 18 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Oct 19 2004
STATUS
approved