login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A274025
Primes p such that Sum_{k=primes<p} (k mod p) and Sum_{k=primes<p} (p mod k) are both prime.
1
5, 691, 2399, 3433, 5099, 6217, 7451, 9007, 10253, 10883, 16561, 21839, 23189, 25679, 26501, 30661, 39097, 41443, 43591, 48119, 50893, 56009, 60293, 64927, 65537, 78979, 79829, 85853, 98669, 100403, 105491, 115981, 124783, 140557, 142547, 148013, 149953, 164113, 166219, 169249
OFFSET
1,1
COMMENTS
As 0 < k < p, k mod p = k, so Sum_{k = primes<p} (k mod p) = A007504(A000720(A151799(p))) for p > 3. - David A. Corneth, Jun 07 2016
LINKS
EXAMPLE
2 mod 5 = 2, 3 mod 5 = 3 and 2 + 3 = 5 is prime;
5 mod 2 = 1, 5 mod 3 = 2 and 1 + 2 = 3 is prime.
MAPLE
with(numtheory): P:=proc(q) local a, b, j, k, n; for j from 1 to q do n:=ithprime(j); a:=0; b:=0; for k from 1 to n-1 do
if isprime(k) then a:=a+k; b:=b+(n mod k); fi; od;
if isprime(a) and isprime(b) then print(n); fi; od; end: P(10^6);
# Alternative:
N:= 10^6: # to get all entries <= N
Primes:= select(isprime, [2, seq(i, i=3..N, 2)]):
PS:= ListTools:-PartialSums(Primes):
count:= 0:
for i from 2 to nops(Primes) do
n := Primes[i];
if isprime(PS[i-1]) and isprime(add(n mod Primes[j], j=1..i-1)) then
count:= count+1;
A[count]:= n;
fi
od:
seq(A[i], i=1..count); # Robert Israel, Jun 07 2016
PROG
(PARI) is(n) = {if(isprime(n), my(nk, kn, u=prime(primepi(n-1)));
forprime(k=2, u, kn+=k; nk+=n%k); isprime(kn)&&isprime(nk), 0)} \\ David A. Corneth, Jun 07 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava, Jun 07 2016
STATUS
approved