%I #18 Jul 07 2016 23:54:46
%S 2,4,8,12,20,28,32,40,48,52,72,80,108,112,132,148,168,180,188,220,232,
%T 240,248,252,260,268,292,300,312,320,340,352,360,368,408,412,420,448,
%U 460,472,480,500,512,520,528,540,560,568,600,612,628,652,680,700,768
%N Stationary value of quotient in the continued fraction expansion of sqrt(prime) when the quotient-cycle-length = 1.
%C Absolute value of the difference between each prime of form n^2+1 and the nearest square > n^2+1. [_Michel Lagneau_, Aug 09 2014]
%H Ron Knott, <a href="http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/cfINTRO.html">An Introduction to Continued Fractions</a>
%F a(n) = 2*A005574(n). For n=sqrt(p) the transient is n, the stationary quotient is 2n.
%e cfrac(sqrt(577),5): 24+1/(48+1/(48+1/(48+1/(48+1/(48+`...`))))) thus a(9) = 48 = 2*A005574(9).
%o (PARI) lista(nn) = {for (n=1, nn, if (isprime(p=n^2+1), k = 1; while (!issquare(p+k), k++); print1(k, ", ");););} \\ _Michel Marcus_, Aug 10 2014, after comment by _Michel Lagneau_
%Y Cf. A005574, A002496.
%K nonn
%O 0,1
%A _Labos Elemer_, Feb 22 2001