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!)
A284950 Number of primes p <= n such that 2*n-p and 2*n+p are prime. 2

%I #15 Jul 21 2020 06:02:23

%S 0,0,0,1,1,1,1,1,1,1,0,2,1,0,3,0,1,3,0,1,3,1,0,3,1,0,3,1,0,5,0,1,4,0,

%T 1,3,0,1,4,0,0,4,1,0,6,0,0,4,0,1,2,1,1,4,1,0,4,0,0,9,0,0,5,0,0,5,1,0,

%U 4,0,0,5,0,0,6,0,1,5,0,1,5,0,0,7,1,0,5,1,0,7,0,0,6,0,0,4,1,1,4,0

%N Number of primes p <= n such that 2*n-p and 2*n+p are prime.

%C If n is not divisible by 3, a(n)<=1, as the only possible p is 3. - _Robert Israel_, Jul 20 2020

%H Robert Israel, <a href="/A284950/b284950.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) is 1, because of all the pairs of primes p1 <= p2 which sum to 5*2=10, namely {3,7} and {5,5}, only (3,7) has p1+10 prime.

%p f:= proc(n) local p1,p2,t;

%p t:= 0: p1:= 2:

%p do

%p p1:= nextprime(p1);

%p if p1 > n then return t fi;

%p if isprime(p1+2*n) and isprime(2*n-p1) then

%p t:= t+1

%p fi

%p od

%p end proc:

%p map(f, [$1..1000]); # _Robert Israel_, Jul 20 2020

%t For[i = 1, i < 1001, i++,

%t ee = 2*i;

%t a = 0;

%t For[j = 3, j < ee/2, j += 2,

%t If[PrimeQ[j] == True && PrimeQ[ee - j] == True,

%t If[PrimeQ[ee + j] == True, a += 1, a = a]]];

%t Print[ee, " ", a]]

%Y Cf. A237885, A284919, A284928.

%K nonn,look

%O 1,12

%A _Neil Fernandez_, Apr 06 2017

%E Definition corrected by _Robert Israel_, Jul 20 2020

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 July 22 05:01 EDT 2024. Contains 374480 sequences. (Running on oeis4.)