%I #14 Jan 01 2020 19:12:28
%S 380,14,5,5,365,8,5,5,14,20,5,20,8,65,8,95,35,8,14,65,20,65,8,17,350,
%T 188,5,104,98,68,35,17,158,35,92,50,62,5,26,8,8,68,233,110,5,50,23,23,
%U 8,65,59,35,14,23,35,20,47,140,5,50,14,5,44,125,386,713,23,59,44,635,98
%N Least number B such that (A001359(n) - B^2)^2 - B is also the lesser of larger twin primes, or 0 if no such B exists.
%C Conjecture: No term is zero.
%H Amiram Eldar, <a href="/A099728/b099728.txt">Table of n, a(n) for n = 1..10000</a>
%e a(3) = 5 since A001359(3) = 11, 11 and 13 are twin primes, (11 - 5^2)^2 - 5 = 191, and 191 and 193 are also twin primes.
%p a135 := [] : f := fopen("b001359.txt",READ) : while nops(a135) < 200 do l := fscanf(f,"%d %d") : if l = [] then break : else a135 := [op(a135),l[2]] : fi ; od : for n from 1 to nops(a135) do a := op(n,a135) : B := 0 : while true do srch := (a-B^2)^2-B ; if isprime(srch) and isprime(srch+2) and srch > a then printf("%d, ",B) ; break ; fi ; B := B+1 : od : od: # _R. J. Mathar_, Aug 06 2007
%t f[p_] := Module[{b = 1}, While[(pb = (p - b^2)^2 - b) <= p || ! And @@ PrimeQ[pb + {0, 2}], b++]; b]; seq = {}; Do[If[And @@ PrimeQ[p + {0, 2}], AppendTo[seq, f[p]]], {p, 2, 3000}]; seq (* _Amiram Eldar_, Dec 30 2019 *)
%Y Cf. A001359, A099742.
%K nonn
%O 1,1
%A _Ray G. Opao_, Nov 07 2004
%E Corrected and extended by _R. J. Mathar_, Aug 06 2007
%E Data corrected by _Amiram Eldar_, Dec 30 2019