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!)
A163057 An alternating sum from the n-th odd number up to the n-th odd prime. 2
2, 4, 6, 9, 11, 14, 16, 19, 23, 25, 29, 32, 34, 37, 41, 45, 47, 51, 54, 56, 60, 63, 67, 72, 75, 77, 80, 82, 85, 93, 96, 100, 102, 108, 110, 114, 118, 121, 125, 129, 131, 137, 139, 142, 144, 151, 158, 161, 163, 166, 170, 172, 178, 182, 186, 190, 192, 196, 199, 201, 207, 215 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Define the alternating sum S(n) = -Sum_{j=0..n} (-1)^j*j = -A130472(n).
Then a(n) = S(n-th odd prime) - S((n-th odd number) - 1), as if the sum were ranging over all j from the n-th odd number up to the n-th odd prime.
LINKS
FORMULA
a(n) = -A130472(A065091(n)) + A130472(A005408(n-1) - 1).
EXAMPLE
a(1) = 1 - 2 + 3 = 2;
a(2) = 3 - 4 + 5 = 4;
a(3) = 5 - 6 + 7 = 6;
a(4) = 7 - 8 + 9 - 10 + 11 = 9;
a(5) = 9 - 10 + 11 - 12 + 13 = 11;
a(6) = 11 - 12 + 13 - 14 + 15 - 16 + 17 = 14.
MAPLE
A130472 := proc(n) (-1)^n*floor((n+1)/2) ; end:
A005408 :=proc(n) 2*n+1 ; end:
A065091 :=proc(n) ithprime(n+1) ; end:
A163057 := proc(n) -A130472(A065091(n)) + A130472(A005408(n-1) -1) ; end: seq(A163057(n), n=1..80) ; # R. J. Mathar, Jul 27 2009
CROSSREFS
Cf. A065091.
Sequence in context: A224995 A091626 A085223 * A242137 A138326 A274214
KEYWORD
nonn
AUTHOR
EXTENSIONS
Rephrased in terms of A130472 by R. J. Mathar, Jul 27 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 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)