OFFSET
2,1
LINKS
Christian Krause, LODA program
FORMULA
Difference of the triangular numbers corresponding to the sum of first (n+1) primes and that of first n primes/prime(n) for n > 1.
a(n) = (A061802(n-1) + 1)/2. - Hugo Pfoertner, Apr 30 2021
a(n) = A007504(n) - (prime(n)-1)/2. - Andrew Howroyd, Apr 30 2021
a(n) = (Sum_{i=2..n-1} A001043(i)) / 2 + 4. - Christian Krause, May 06 2021
MATHEMATICA
Table[ Sum[ Prime[i], {i, 1, n}] - Floor[ Prime[n]/2], {n, 2, 50}]
For[lst={}; n1=3; n=2, n<=100, n++, n2=n1+Prime[n]; AppendTo[lst, (n2+n1-1)/2]; n1=n2]; lst
Module[{nn=50, no, pr}, no=Total[Prime[Range[2, nn+1]]]; pr=Prime[Range[2, nn]]; #[[ (Length[ #]+1)/2]]&/@TakeList[Range[3, no], pr]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Sep 20 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 05 2002
EXTENSIONS
Edited by Robert G. Wilson v and T. D. Noe, Aug 08 2002
STATUS
approved