login
A338984
a(n) is the sum of (q mod p) for pairs of primes p<q such that p+q=2*n.
2
0, 0, 0, 2, 1, 2, 2, 2, 7, 8, 3, 9, 7, 9, 14, 8, 6, 14, 3, 14, 18, 9, 14, 37, 26, 16, 28, 24, 13, 40, 7, 45, 42, 11, 20, 54, 27, 35, 37, 15, 43, 82, 22, 13, 99, 49, 24, 66, 32, 54, 90, 67, 32, 123, 90, 86, 141, 55, 53, 142, 49, 36, 164, 24, 96, 114, 48, 114, 113, 92, 118, 133, 83, 79, 198, 40
OFFSET
1,4
LINKS
FORMULA
a(n) = Sum_{k=1..n} ((2*n-k) mod k) * c(k) * c(2*n-k), where c is the prime characteristic (A010051). - Wesley Ivan Hurt, Dec 22 2020
EXAMPLE
a(9) = 7 because 2*9 = 5 + 13 = 7 + 11 with (13 mod 5) + (11 mod 7) = 3 + 4 = 7.
MAPLE
N:= 200: # for a(1)..a(N/2)
P:= select(isprime, [seq(i, i=3..N, 2)]):
nP:= nops(P):
V:= Vector(N):
for i from 1 to nP do
for j from i+1 to nP do
v:= P[i]+P[j];
if v > N then break fi;
V[v]:= V[v] + (P[j] mod P[i])
od od:
[seq(V[2*i], i=1..N/2)];
MATHEMATICA
Table[Sum[Mod[2 n - k, k] (PrimePi[k] - PrimePi[k - 1]) (PrimePi[2 n - k] - PrimePi[2 n - k - 1]), {k, n}], {n, 60}] (* Wesley Ivan Hurt, Dec 22 2020 *)
CROSSREFS
Cf. A010051.
Sequence in context: A089254 A279861 A321431 * A140085 A071445 A144081
KEYWORD
nonn,look
AUTHOR
J. M. Bergot and Robert Israel, Dec 20 2020
STATUS
approved