login

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”).

a(n) is the least prime p such that (p^2-2*n)/(2*n-1) and (p^2+2*n)/(2*n+1) are both prime, or 0 if such p does not exist.
1

%I #8 May 20 2021 22:58:20

%S 2,0,239,251,2069,131,521,0,2243,379,643,40849,89101,11717,81839,

%T 18787,659,0,2887,41081,199261,13931,4231,223439,17443,953,3499,6689,

%U 122131,298777,9883,0,93131,12329,48989,67307,9199,44549,13903,294353,605071,42331,7309,167677,41651,46747,129581

%N a(n) is the least prime p such that (p^2-2*n)/(2*n-1) and (p^2+2*n)/(2*n+1) are both prime, or 0 if such p does not exist.

%C a(n) = 0 if 2*n is a square.

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

%e a(3) = 239 because 239, (239^2-2*3)/(2*3-1) = 11423, and (239^2+2*3)/(2*3+1) = 8161 are primes, and no smaller prime works.

%p f:= proc(n) local M,p,i,j;

%p if issqr(2*n) then return 0 fi;

%p M:= sort(map(t -> rhs(op(t)), [msolve(p^2=1,4*n^2-1)]));

%p for i from 0 to 10^6 do

%p for j in M do

%p p:= i*(4*n^2-1)+j;

%p if isprime(p) and isprime((p^2-2*n)/(2*n-1)) and isprime((p^2+2*n)/(2*n+1)) then return p fi

%p od od;

%p FAIL

%p end proc:

%p map(f, [$1..100]);

%Y Cf. A001105.

%K nonn

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, May 19 2021