A162848 An alternating 2-based sum from prime(n) up to the base of the n-th Mersenne prime.
0, 5, 7, 9, 18, 25, 24, 51, 120, 181, 223, 264, 1243, 1455, 3129, 5430, 5616, 7953, 10534, 10953, 24115, 24736, 27910, 49711, 54109, 57873, 111090, 215449, 276096, 329955, 540039, 1891903, 2148379, 3144261, 3495451, 7440328, 7553209, 17431240, 33667044
Offset: 1
Keywords
Examples
a(1) = 2 - 2 = 0; a(2) = 2 + 3 = 5; a(3) = 2 + 5 = 7; a(4) = 2 + 7 = 9; a(5) = 2 + 11 + 2 - 12 + 2 + 13 = 18.
Programs
-
Maple
A152832 := proc(n) (n+1)/2-(9*(-1)^n+1)/4 ; end: S := proc(u) 2*u-(-1)^u*A152832(u) ; end: A000043 := proc(n) op(n,[ 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917 ]) ; end: A162848 := proc(n) S( A000043(n))-S(ithprime(n)-1) ; end: seq(A162848(n),n=1..39) ; # R. J. Mathar, Aug 14 2009
Extensions
Corrected from a(8) on by R. J. Mathar, Aug 14 2009
Comments