OFFSET
0,2
COMMENTS
After 3, this is never prime because all values thereafter are multiples of 3. Starting from a(6) all are also multiples of 17. - Jonathan Vos Post, Feb 10 2010
Starting from a(162) all are also multiples of 967. - Alex Ratushnyak, May 14 2013
Repunits in primorial base, A049345. - Antti Karttunen, Aug 21 2016
LINKS
Soumyadeep Dhar, Table of n, a(n) for n = 0..350 (terms up to a(100) from T. D. Noe)
FORMULA
a(n) = Sum_{k=0..n} prime(k)#, where prime(n)# = A002110(n).
EXAMPLE
a(3) = 39 = (1 + 2 + 6 + 30), where A002110 = (1, 2, 6, 30, 210, 2310,...).
MAPLE
b:= proc(n) option remember; `if`(n=0, [1$2], (h->
(p-> [p, p+h[2]])(ithprime(n)*h[1]))(b(n-1)))
end:
a:= n-> b(n)[2]:
seq(a(n), n=0..19); # Alois P. Heinz, Feb 23 2022
MATHEMATICA
Table[s = 1; Do[s = 1 + s*Prime[i], {i, n, 1, -1}]; s, {n, 0, 20}] (* T. D. Noe, May 03 2013 *)
Accumulate[FoldList[Times, 1, Prime[Range[20]]]] (* Harvey P. Dale, Feb 05 2015 *)
PROG
(PARI) a(n)=if(n==0, return(1)); my(P=1, s=1); forprime(p=2, prime(n), s+=P*=p); s \\ Charles R Greathouse IV, Feb 05 2014
(Python)
from itertools import chain, accumulate, count, islice
from operator import mul
from sympy import prime
def A143293_gen(): # generator of terms
return accumulate(accumulate(chain((1, ), (prime(n) for n in count(1))), mul))
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Aug 05 2008
EXTENSIONS
a(11)-a(19) from Jonathan Vos Post, Feb 10 2010
STATUS
approved