OFFSET
1,4
COMMENTS
Conjecture: the only n for which a(n) <= n are 1, 2, 3, 5, 7, 11, 19, and 31.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=5, we have 2*n = 3+7 = 5+5, and a(5) = (10 mod 3)+(10 mod 5)+(10 mod 7) = 1+0+3 = 4.
MAPLE
N:= 1000: # for a(1)..a(N)
P:= select(isprime, [seq(i, i=3..2*N)]):
f:= proc(n) local m, Q, q;
m:= ListTools:-BinaryPlace(P, 2*n);
Q:= convert(P[1..m], set);
Q:= Q intersect map(t -> 2*n-t, Q);
add(2*n mod q, q = Q);
end proc:
map(f, [$1..N]);
PROG
(PARI) a(n) = my(p=2, s=0); forprime(p=2, 2*n, if (isprime(2*n-p), s += (2*n % p))); s; \\ Michel Marcus, Apr 20 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 20 2021
STATUS
approved
