%I #14 Dec 29 2020 02:54:59
%S 2,0,0,5,3,53,139,157,61,1151,3833,6653,7159,30713,4093,204797,311293,
%T 360439,2555897,3014653,786431,11010037,5242877,73400311,138412031,
%U 461373431,1124073463,436207613,3288334303,10066329587,1879048183,8053063661,102005473259,40802189303,193273528303,403726925821
%N a(n) is the least prime p such that the 2-adic valuation of q^2-p^2 is n, where q is the next prime after p, or 0 if there is no such p.
%C a(n) = A340117(n-1) for n >= 3.
%H Robert Israel, <a href="/A340116/b340116.txt">Table of n, a(n) for n = 0..1000</a>
%e a(3) = 5 because 5 is prime, the next prime is 7, 7^2-5^2 = 24 = 2^3*3, and this is the first prime p in which 2^3 appears in the factorization of q^2-p^2.
%p g:= proc(m) local k,p;
%p for k from 2^(m-2) by 2^(m-1) do
%p p:= prevprime(k);
%p if nextprime(p) = 2*k-p then return p fi
%p od
%p end proc:
%p g(0):= 2: g(1):= 0: g(2):= 0: g(3):= 5:
%p map(g, [$0..30]);
%Y Cf. A007814
%K nonn
%O 0,1
%A _J. M. Bergot_ and _Robert Israel_, Dec 28 2020