login
A338769
Sum of the remainders (p*q mod n) with p,q prime, p + q = n and p < q.
2
0, 0, 0, 0, 1, 0, 3, 7, 5, 1, 0, 11, 9, 5, 11, 14, 0, 16, 15, 22, 17, 32, 0, 69, 21, 20, 0, 22, 0, 51, 27, 46, 29, 49, 0, 80, 0, 27, 35, 101, 0, 80, 39, 81, 41, 91, 0, 163, 45, 112, 0, 105, 0, 139, 51, 133, 0, 87, 0, 162, 57, 64, 59, 179, 0, 204, 0, 78, 65, 241, 0, 258, 69
OFFSET
1,7
LINKS
FORMULA
a(n) = Sum_{i=1..floor((n-1)/2)} ( i*(n-i) mod n ) * c(i) * c(n-i), where c is the prime characteristic (A010051).
EXAMPLE
a(14) = (3*11 mod 14) = 5. We don't count (7*7 mod 14) since we have p < q.
MAPLE
f:= proc(n) local L;
if n::odd then if isprime(n-2) then n-4 else 0 fi
else
add((-x^2) mod n, x = select(t -> isprime(t) and isprime(n-t), [seq(i, i=3..(n-1)/2, 2)]))
fi
end proc:
map(f, [$1..100]); # Robert Israel, Nov 25 2020
MATHEMATICA
Table[Sum[(PrimePi[i] - PrimePi[i - 1]) (PrimePi[n - i] - PrimePi[n - i - 1]) Mod[i (n - i), n], {i, Floor[(n - 1)/2]}], {n, 80}]
CROSSREFS
Sequence in context: A322931 A096627 A065084 * A132742 A267317 A377144
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 07 2020
STATUS
approved