%I #65 Sep 08 2022 08:44:56
%S 1,9,121,1681,23409,326041,4541161,63250209,880961761,12270214441,
%T 170902040409,2380358351281,33154114877521,461777249934009,
%U 6431727384198601,89582406128846401,1247721958419651009,17378525011746267721,242051628206028097081
%N Indices of octagonal numbers which are also squares.
%C The equation a(t)*(3*a(t)-2) = m*m is equivalent to the Pell equation (3*a(t)-1)*(3*a(t)-1) - 3*m*m = 1. - _Paul Weisenhorn_, May 12 2009
%C As n increases, this sequence is approximately geometric with common ratio r = lim_{n -> infinity} a(n)/a(n-1) = (2 + sqrt(3))^2 = 7 + 4 * sqrt(3). - _Ant King_, Nov 16 2011
%C Also numbers n such that the octagonal number N(n) is equal to the sum of two consecutive triangular numbers. - _Colin Barker_, Dec 11 2014
%C Also nonnegative integers y in the solutions to 2*x^2 - 6*y^2 + 4*x + 4*y + 2 + 2 = 0, the corresponding values of x being A251963. - _Colin Barker_, Dec 11 2014
%H Vincenzo Librandi, <a href="/A046184/b046184.txt">Table of n, a(n) for n = 1..200</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/OctagonalSquareNumber.html">Octagonal Square Number.</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (15,-15,1).
%F {n: A000567(n) in A000290}.
%F Nearest integer to (1/6) * (2+sqrt(3))^(2n-1). - _Ralf Stephan_, Feb 24 2004
%F a(n) = A045899(n-1) + 1 = A051047(n+1) + 1 = A003697(2n-2). - _N. J. A. Sloane_, Jun 12 2004
%F a(n) = A001835(n)^2. - _Lekraj Beedassy_, Jul 21 2006
%F From _Paul Weisenhorn_, May 12 2009: (Start)
%F With A=(2+sqrt(3))^2=7+4*sqrt(3) the equation x*x-3*m*m=1 has solutions
%F x(t) + sqrt(3)*m(t) = (2+sqrt(3))*A^t and the recurrences
%F x(t+2) = 14*x(t+1) - x(t) with <x(t)> = 2, 26, 362, 5042
%F m(t+2) = 14*m(t+1) - m(t) with <m(t)> = 1, 15, 209, 2911
%F a(t+2) = 14*a(t+1) - a(t) - 4 with <a(t)> = 1, 9, 121, as above. (End)
%F From _Ant King_, Nov 15 2011: (Start)
%F a(n) = 14*a(n-1) - a(n-2) - 4.
%F a(n) = 15*a(n-1) - 15*a(n-2) + a(n-3).
%F a(n) = (1/6)*( (2+sqrt(3))^(2n-1) + (2-sqrt(3))^(2n-1) + 2 ).
%F a(n) = ceiling( (1/6)*(2 + sqrt(3))^(2n-1) ).
%F a(n) = (1/6)*( (tan(5*Pi/12))^(2n-1) + (tan(Pi/12))^(2n-1) + 2 ).
%F a(n) = ceiling ( (1/6)*(tan(5*Pi/12))^(2n-1) ).
%F G.f.: x*(1-6*x+x^2) / ((1-x)*(1-14*x+x^2)). (End)
%F a(n) = A006253(2n-2). - _Andrey Goder_, Oct 17 2021
%t LinearRecurrence[ {15, -15, 1}, {1, 9, 121}, 17 ] (* _Ant King_, Nov 16 2011 *)
%t CoefficientList[Series[x (1-6x+x^2)/((1-x)(1-14x+x^2)),{x,0,30}],x] (* _Harvey P. Dale_, Sep 01 2021 *)
%o (Magma) I:=[1, 9, 121]; [n le 3 select I[n] else 15*Self(n-1)-15*Self(n-2)+Self(n-3): n in [1..20]]; // _Vincenzo Librandi_, Nov 17 2011
%o (PARI) Vec(x*(1-6*x+x^2) / ((1-x)*(1-14*x+x^2)) + O(x^100)) \\ _Colin Barker_, Dec 11 2014
%Y Cf. A028230, A036428, A251963.
%Y Cf. A006253.
%K nonn,easy
%O 1,2
%A _Eric W. Weisstein_