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

 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 Robert Israel, Table of n, a(n) for n = 1..10000 FORMULA a(n) = -A130472(A065091(n)) + A130472(A005408(n-1) - 1). a(n) = (1/2)*(-1 + 2n + A000040(n + 1)). - David Trimas, Jul 21 2024 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 MATHEMATICA 1/2 (-1 + 2 # + Prime[# + 1]) & /@ Range[100] (* David Trimas, Jul 21 2024 *) PROG (Python) from sympy import sieve as A000040 def A163057(n): return n + A000040[n + 1] // 2 # Karl-Heinz Hofmann, Jul 23 2024 CROSSREFS Cf. A000040, A065091, A005408, A130472. Sequence in context: A224995 A091626 A085223 * A242137 A138326 A274214 Adjacent sequences: A163054 A163055 A163056 * A163058 A163059 A163060 KEYWORD nonn,easy AUTHOR Juri-Stepan Gerasimov, Jul 20 2009 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.

Last modified August 14 05:41 EDT 2024. Contains 375146 sequences. (Running on oeis4.)