login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A000367 A176546 A092133 * A281585 A071772 A201005
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava, Jun 07 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 15 19:19 EDT 2024. Contains 375173 sequences. (Running on oeis4.)