login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A274025 Primes n such that Sum_{k = primes<n}{k mod n} and Sum_{k = primes<n}{n 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 < n, k mod n == k, so Sum_{k = primes<n}{k mod n} = A007504(A000720(A151799(n))) for n > 3. - David A. Corneth, Jun 07 2016

LINKS

Robert Israel, Table of n, a(n) for n = 1..1003

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

Cf. A000040, A000720, A007504, A151799.

Sequence in context: A000367 A176546 A092133 * A281585 A071772 A201005

Adjacent sequences:  A274022 A274023 A274024 * A274026 A274027 A274028

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 | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 16 20:34 EDT 2018. Contains 316275 sequences. (Running on oeis4.)