login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A162939 A 1-based alternate sum over the numbers from 0 to prime(n). 3
1, 5, 8, 11, 17, 20, 26, 29, 35, 44, 47, 56, 62, 65, 71, 80, 89, 92, 101, 107, 110, 119, 125, 134, 146, 152, 155, 161, 164, 170, 191, 197, 206, 209, 224, 227, 236, 245, 251, 260, 269, 272, 287, 290, 296, 299, 317, 335, 341, 344, 350, 359, 362, 377, 386, 395, 404 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Define a 1-based sum S(n) = sum_{i=1..n} (1 - (-1)^i*i) = A014682(n).
a(n) is this sum evaluated for the upper limit prime(n) = A000040(n).
a(n) = prime(n) + (prime(n)+1)/2 for n>1. (E.g., 3 + 4/2 = 5, 5 + 6/2 = 8, 7 + 8/2 = 11, ....) - Vladimir Joseph Stephan Orlovsky, Nov 30 2009 [edited by Jon E. Schoenfield, Feb 10 2015]
LINKS
EXAMPLE
a(1) = 1-1*(-1)^1+1-2*(-1)^2 = 1+1+1-2 = 1.
a(3) = 1-1*(-1)^1+1-2*(-1)^2+1-3*(-1)^3+1-4*(-1)^4+1-5*(-1)^5 = 1+1+1-2+1+3+1-4+1+5 = 8.
MAPLE
A014682 := proc(n) option remember; coeftayl( x*(2+x+x^2)/(1-x^2)^2, x=0, n) ; end:
A162939 := proc(n) A014682(ithprime(n)) ; end: seq(A162939(n), n=1..70) ; # R. J. Mathar, Jul 21 2009
MATHEMATICA
f[n_]:=n/2; lst={}; Do[p=Prime[n]; AppendTo[lst, p+f[p+1]], {n, 2, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Nov 30 2009 *)
CROSSREFS
Cf. A000040.
Sequence in context: A325598 A314392 A314393 * A314394 A056955 A023381
KEYWORD
nonn
AUTHOR
EXTENSIONS
Definition edited by R. J. Mathar, Jul 21 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 16:34 EDT 2024. Contains 371961 sequences. (Running on oeis4.)