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.

A162848 An alternating 2-based sum from prime(n) up to the base of the n-th Mersenne prime.

This page as a plain text file.
%I A162848 #7 Mar 10 2019 19:33:40
%S A162848 0,5,7,9,18,25,24,51,120,181,223,264,1243,1455,3129,5430,5616,7953,
%T A162848 10534,10953,24115,24736,27910,49711,54109,57873,111090,215449,276096,
%U A162848 329955,540039,1891903,2148379,3144261,3495451,7440328,7553209,17431240,33667044
%N A162848 An alternating 2-based sum from prime(n) up to the base of the n-th Mersenne prime.
%C A162848 Define a 2-based sum S(l,u) = Sum_{j=l..u} (2 - j*(-1)^j). Then a(n) is this sum evaluated with a lower limit l = A000040(n) = prime(n) and with an upper limit u = A000043(n).
%F A162848 a(n) = Sum_{j=A000040(n)..A000043(n)} (2 - j*(-1)^j).
%e A162848 a(1) = 2 - 2 = 0;
%e A162848 a(2) = 2 + 3 = 5;
%e A162848 a(3) = 2 + 5 = 7;
%e A162848 a(4) = 2 + 7 = 9;
%e A162848 a(5) = 2 + 11 + 2 - 12 + 2 + 13 = 18.
%p A162848 A152832 := proc(n) (n+1)/2-(9*(-1)^n+1)/4 ; end:
%p A162848 S := proc(u) 2*u-(-1)^u*A152832(u) ; end:
%p A162848 A000043 := proc(n) op(n,[ 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607,
%p A162848 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497,
%p A162848 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917 ]) ; end:
%p A162848 A162848 := proc(n) S( A000043(n))-S(ithprime(n)-1) ; end: seq(A162848(n),n=1..39) ; # _R. J. Mathar_, Aug 14 2009
%Y A162848 Cf. A000040, A000043, A162938.
%K A162848 nonn
%O A162848 1,2
%A A162848 _Juri-Stepan Gerasimov_, Jul 21 2009
%E A162848 Corrected from a(8) on by _R. J. Mathar_, Aug 14 2009