OFFSET
1,2
COMMENTS
Partial sums of A006005.
EXAMPLE
For n = 5 the first five odd noncomposite numbers are 1, 3, 5, 7, 11, so a(5) = 1 + 3 + 5 + 7 + 11 = 27.
MAPLE
a := proc(n) option remember; `if`(n=1, 1, a(n-1) + ithprime(n)) end:
seq(a(n), n=1..49); # Peter Luschny, Sep 20 2018
MATHEMATICA
a[1]=1; a[n_]:=a[n]=a[n-1]+Prime[n]; Table[a[n], {n, 1, 49}] (* Robert P. P. McKone, Jan 18 2022 *)
PROG
(PARI) terms(n) = my(s=1, i=0); forprime(p=3, , if(i >= n, break, print1(s, ", "); i++; s=s+p))
/* Print initial 50 terms as follows */
terms(50) \\ Felix Fröhlich, Sep 20 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Feb 21 2014
STATUS
approved