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!)
A224963 Let p = prime(n). a(n) = number of primes q less than p, such that both p+q+1 and p+q-1 are primes. 1

%I #9 Oct 20 2020 16:06:27

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

%T 3,5,5,4,5,6,4,8,4,3,4,6,6,6,3,5,5,7,6,6,2,4,6,5,2,6,5,5,5,5,3,3,8,5,

%U 4,8,4,7,4,7,7,4,7,3,5,8,9,9,6,6,7

%N Let p = prime(n). a(n) = number of primes q less than p, such that both p+q+1 and p+q-1 are primes.

%H Harvey P. Dale, <a href="/A224963/b224963.txt">Table of n, a(n) for n = 1..1000</a>

%e For n=3, p=5, there are no primes q(<5) such that both 5+q+1 and 5+q-1 are primes and hence a(3)=0. Also for n=5, p=11, there is a(5)=1 solution 7 since 11+7+1=19, 11+7-1=17.

%t Table[p = Prime[n]; c = 0; i = 1; While[i < n, p1 = p + Prime[i]; If[PrimeQ[p1 + 1] && PrimeQ[p1 - 1], c = c + 1]; i++]; c, {n, 85}]

%t pq1[n_]:=Module[{pr1=Prime[Range[n-1]],pr2=Prime[n]},Total[ Table[ If[ AllTrue[pr2+pr1[[k]]+{1,-1},PrimeQ],1,0],{k,Length[pr1]}]]]; Array[ pq1,100] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Oct 20 2020 *)

%Y Cf. A224748, A224908.

%K nonn

%O 1,9

%A _Jayanta Basu_, Apr 21 2013

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 4 13:44 EDT 2024. Contains 374923 sequences. (Running on oeis4.)