OFFSET
1,1
COMMENTS
Theorem. a(n) <= p_n + 2*sqrt(2*p_n) + 2. For example, for n=25, p_n=97. Using the theorem, we find: a(25) <= 126. Now, by the definition of the sequence, we verify that a(25)=113.
Or a(n) is the maximal prime q_n > p_n such that sqrt(q_n)-sqrt(p_n) < sqrt(2) [or (p_n+q_n)/2 < sqrt(p_n*q_n)+1]. I conjecture that lim_{n->infinity} (sqrt(q_n) - sqrt(p_n)) = sqrt(2). Note that in the considered case this conjecture is equivalent to the following: lim_{n->infinity} fract(sqrt(p_n*q_n)) = 0, where fract(x) denotes the fractional part of x. - Vladimir Shevelev, Oct 09 2008
MATHEMATICA
a[n_] := Module[{pmax = 0, pn = Prime[n]}, p=2; While[p <= pn + 2*Floor[Sqrt[2*pn]] + 2, If[IntegerQ[Sqrt[Ceiling[Sqrt[p*pn]]^2-p*pn]], pmax = p]; p=NextPrime[p]]; pmax]; Array[a, 60] (* Amiram Eldar, Dec 16 2018 from the PARI code *)
PROG
(PARI) a(n) = {my (pmax = 0, pn = prime(n)); forprime(p=2, pn+2*sqrtint(2*pn)+2, if (issquare((ceil(sqrt(p*pn)))^2-p*pn), pmax = p); ); pmax; } \\ Michel Marcus, Dec 16 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Oct 06 2008
EXTENSIONS
More terms from Michel Marcus, Dec 16 2018
STATUS
approved