login
A276824
a(n) = p-s, where s = Sum_{i=1..n} prime(i) and p = primepi(prime(n)^2).
0
0, -1, -1, -2, 2, -2, 3, -5, -1, 17, 2, 22, 25, 2, 1, 28, 47, 18, 41, 36, -7, 20, 12, 37, 103, 91, 30, 10, -57, -70, 157, 125, 153, 63, 213, 120, 145, 168, 129, 154, 170, 65, 230, 114, 61, -63, 189, 445, 386, 239, 172, 203, 52, 239, 257, 268
OFFSET
1,4
FORMULA
a(n) = A000879(n) - A007504(n).
EXAMPLE
n= 10, prime(10) = 29, s = Sum_{i=1,10} prime(i) = 2+3+5+7+11+13+17+19+23+29 = 129,
p= primepi(29^2) = primepi(841) = 146. So a(10) = p-s = 146 - 129 = 17.
PROG
(PARI) a(n) = primepi(prime(n)^2) - sum(k=1, n, prime(k)); \\ Michel Marcus, Oct 17 2016
CROSSREFS
Sequence in context: A103894 A022868 A228405 * A235998 A303949 A333462
KEYWORD
sign
AUTHOR
Dimitris Valianatos, Sep 27 2016
STATUS
approved