%I #109 Aug 27 2024 11:45:26
%S 2,14,82,478,2786,16238,94642,551614,3215042,18738638,109216786,
%T 636562078,3710155682,21624372014,126036076402,734592086398,
%U 4281516441986,24954506565518,145445522951122,847718631141214,4940866263896162,28797478952235758,167844007449518386
%N Numbers k such that (k^2 + 4)/2 is a square.
%C The equation "(k^2 + 4)/2 is a square" is a version of the generalized Pell Equation x^2 - D*y^2 = C where x^2 - 2*y^2 = -4.
%C Sequence of all positive integers k such that continued fraction [k,k,k,k,k,k,...] belongs to Q(sqrt(2)). - _Thomas Baruchel_, Sep 15 2003
%C Equivalently, 2*n^2 + 8 is a square.
%C Numbers n such that (ceiling(sqrt(n*n/2)))^2 = 2 + n^2/2. - _Ctibor O. Zizka_, Nov 09 2009
%C The continued fraction [a(n);a(n),a(n),...] = (1 + sqrt(2))^(2*n-1). - _Thomas Ordowski_, Jun 07 2013
%C a((p+1)/2) == 2 (mod p) where p is an odd prime. - _Altug Alkan_, Mar 17 2016
%D A. H. Beiler, "The Pellian." Ch. 22 in Recreations in the Theory of Numbers: The Queen of Mathematics Entertains. Dover, New York, New York, pp. 248-268, 1966.
%D L. E. Dickson, History of the Theory of Numbers, Vol. II, Diophantine Analysis. AMS Chelsea Publishing, Providence, Rhode Island, 1999, pp. 341-400.
%D Peter G. L. Dirichlet, Lectures on Number Theory (History of Mathematics Source Series, V. 16); American Mathematical Society, Providence, Rhode Island, 1999, pp. 139-147.
%H Amiram Eldar, <a href="/A077444/b077444.txt">Table of n, a(n) for n = 1..1306</a>
%H Sergio Falcon, <a href="http://dx.doi.org/10.4236/am.2014.515216">Relationships between Some k-Fibonacci Sequences</a>, Applied Mathematics, 2014, 5, 2226-2234.
%H Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a>
%H Prabha Sivaraman Nair and Rejikumar Karunakaran, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL27/Nair/nair11.html">On k-Fibonacci Brousseau Sums</a>, J. Int. Seq. (2024) Art. No. 24.6.4. See p. 3.
%H J. J. O'Connor and E. F. Robertson, <a href="https://www-history.mcs.st-andrews.ac.uk/HistTopics/Pell.html">Pell's Equation</a>. [Broken link]
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PellEquation.html">Pell Equation</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/NSWNumber.html">NSW Number</a>.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (6,-1).
%F a(n) = (((3 + 2*sqrt(2))^n - (3 - 2*sqrt(2))^n) + ((3 + 2*sqrt(2))^(n-1) - 3 - 2*sqrt(2))^(n-1))) / (2*sqrt(2)).
%F a(n) = 2*A002315(n-1).
%F Recurrence: a(n) = 6*a(n-1) - a(n-2), starting 2, 14.
%F Offset 0, with a=3+2*sqrt(2), b=3-2*sqrt(2): a(n) = a^((2n+1)/2) - b^((2n+1)/2). a(n) = 2*(A001109(n+1) + A001109(n)) = (A003499(n+1) - A003499(n))/2 = 2*sqrt(A001108(2n+1)) = sqrt(A003499(2n+1)-2). - Mario Catalani (mario.catalani(AT)unito.it), Mar 31 2003
%F Limit_{n->oo} a(n)/a(n-1) = 5.82842712474619009760... = 3 + 2*sqrt(2). See A156035.
%F From _R. J. Mathar_, Nov 16 2007: (Start)
%F G.f.: 2*x*(1+x)/(1-6*x+x^2).
%F a(n) = 2*(7*A001109(n) - A001109(n+1)). (End)
%F a(n) = (1+sqrt(2))^(2*n-1) - (1+sqrt(2))^(1-2*n). - _Gerson Washiski Barbosa_, Sep 19 2010
%F a(n) = floor((1 + sqrt(2))^(2*n-1)). - _Thomas Ordowski_, Jun 07 2013
%F a(n) = sqrt(2*A075870(n)^2-4). - _Derek Orr_, Jun 18 2015
%F a(n) = 2*sqrt((2*A001653(n)^2)-1). - _César Aguilera_, Jul 13 2023
%F E.g.f.: 2*(1 + exp(3*x)*(sqrt(2)*sinh(2*sqrt(2)*x) - cosh(2*sqrt(2)*x))). - _Stefano Spezia_, Aug 27 2024
%t LinearRecurrence[{6,-1},{2,14},30] (* _Harvey P. Dale_, Jul 25 2018 *)
%o (PARI) for(n=1,20,q=(1+sqrt(2))^(2*n-1);print1(contfrac(q)[1],", ")) \\ _Derek Orr_, Jun 18 2015
%o (PARI) Vec(2*x*(1+x)/(1-6*x+x^2) + O(x^100)) \\ _Altug Alkan_, Mar 17 2016
%o (Magma) [n: n in [0..10^8] | IsSquare((n^2 + 4) div 2)]; // _Vincenzo Librandi_, Jun 20 2015
%Y (A077445(n))^2 - 2*a(n) = 8.
%Y First differences of A001541.
%Y Pairwise sums of A001542.
%Y Bisection of A002203 and A080039.
%Y Cf. A001653.
%K nonn,easy
%O 1,1
%A _Gregory V. Richardson_, Nov 09 2002