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”).
%I #15 Apr 02 2024 03:01:13
%S 1,-1,5,0,-1,-1,3,-1,17,0,17,23,15,17,29,9,5,5,0,11,-1,15,17,41,9,0,
%T 53,45,11,0,57,35,29,39,59,0,45,5,59,57,65,71,57,47,71,75,83,29,0,41,
%U 77,45,0,29,87,107,83,105,41,107,69,113,125,111,47,125
%N a(n) = greatest k with -3<k<2*n such that n*(n+1)+k and n*(n+1)+k+2 are twin primes.
%C There are only 11 0 values for n<434, and no more 0 values for n>433.
%C If n>433, a(n) is > A200652.
%H Pierre CAMI, <a href="/A200653/b200653.txt">Table of n, a(n) for n = 1..10000</a>
%p A200653 := proc(n)
%p for k from 2*n-1 to -2 by -1 do
%p if isprime(n*(n+1)+k) and isprime(n*(n+1)+k+2) then
%p return k;
%p end if;
%p end do:
%p return 0 ;
%p end proc:
%p seq(A200653(n),n=1..80) ; # _R. J. Mathar_, Nov 22 2011
%t a[n_]:=Module[{k=0},For[m=-2, m<2n, m++, If[PrimeQ[n(n+1)+m]&&PrimeQ[n(n+1)+m+2], k=m]]; k]; Array[a,66] (* _Stefano Spezia_, Apr 01 2024 *)
%Y Cf. A200652.
%K sign
%O 1,3
%A _Pierre CAMI_, Nov 20 2011