cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A162939 A 1-based alternate sum over the numbers from 0 to prime(n).

Original entry on oeis.org

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
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 18 2009

Keywords

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]

Examples

			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.
		

Crossrefs

Cf. A000040.

Programs

Extensions

Definition edited by R. J. Mathar, Jul 21 2009