login
A185382
Sum_{j=1..n-1} P(n)-P(j), where P(j) = A065091(j) is the j-th odd prime.
5
0, 2, 6, 18, 26, 46, 58, 86, 134, 152, 212, 256, 280, 332, 416, 506, 538, 640, 712, 750, 870, 954, 1086, 1270, 1366, 1416, 1520, 1574, 1686, 2092, 2212, 2398, 2462, 2792, 2860, 3070, 3286, 3434, 3662, 3896, 3976, 4386, 4470, 4642, 4730, 5270
OFFSET
1,2
COMMENTS
It appears 1/3 of a(n) values are divisible by 3 (as measured up to n = 8000). Almost all of these cases occur consecutively (i.e., in "runs"). The sizes of these runs, including runs of 1, in the first 250 primes are given by this sequence: {2, 4, 1, 1, 2, 4, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 5, 6, 3, 2, 2, 3, 3, 9, 1, ..} with two runs up to 12 in length occurring in the first 5000 primes. - Richard R. Forberg, Mar 26 2015
a(n+1) == a(n) (mod 3) iff n == 0 (mod 3) or P(n+1) == P(n) (mod 3); this should have asymptotic probability 2/3, and explains some of the above comment. - Robert Israel, Mar 26 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000 (corrected by Ray Chandler, Jan 19 2019)
FORMULA
a(n) = (n-1)*A065091(n) - A071148(n-1) = (n-1)*prime(n+1) - sum_{1 < k <= n} prime(k). [Corrected and extended by M. F. Hasler, May 02 2015]
a(n) = A206803(n) - A206803(n-1).
a(n) = Sum_{j=1..n-1} j*A001223(j+1). - Robert Israel, Mar 26 2015
EXAMPLE
a(4)=(11-3)+(11-5)+(11-7)=18.
MAPLE
N:= 1000: # to get terms for all odd primes <= N
P:= select(isprime, [seq(2*i+1, i=1..floor((N-1)/2))]):
Q:= ListTools[PartialSums](P):
seq(n*P[n]-Q[n], n=2..nops(P)); # Robert Israel, Mar 26 2015
MATHEMATICA
s[k_] := Prime[k + 1]; p[n_] := Sum[s[k], {k, 1, n}]; c[n_] := n*s[n] - p[n]; Table[c[n], {n, 2, 100}]
PROG
(PARI) A185382(n)=(n-1)*prime(n+1)-sum(k=2, n-1, prime(k)) \\ M. F. Hasler, May 02 2015
CROSSREFS
Cf. A001223, A152535, A206802 (a(n)/2), A206803 (= partial sums of this), A206804, A206817.
Sequence in context: A220142 A032649 A237989 * A257065 A066286 A324541
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 13 2012
EXTENSIONS
Edited and a(1)=0 prefixed by M. F. Hasler, May 02 2015
STATUS
approved