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).
From Antti Karttunen, Apr 04 2026: (Start)
For all n >= 1, A328766(a(n-1)) = n.
A343047(a(n)) = a(2*n).
(End)
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
Subsequence of the following sequences: A276155, A276156, A328462, A328574, A328836, A341433, A351125, A363242, A370132.
Indices of 1's in A328395, in A328399, in A328475 (after their initial 1) and in A343404, in A355037, indices of 0's in A328476 after a(0)=0, positions of records in A328614 (after its initial term).
Cf. A225727 (k such that a(k-1) is divisible by k), A225728, A283985, A343047, A357270 [= a(n) mod prime(1+n)], A392616 (the least k>=1 such that a(n)+k is prime), A394891 (k such that a(k) is in A048103), A394892 (k such that a(k) is not in A048103).
The first column of A391935.
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Aug 05 2008
EXTENSIONS
a(11)-a(19) from Jonathan Vos Post, Feb 10 2010
STATUS
approved
