%I #37 Sep 08 2022 08:44:56
%S 1,5,221,1513,71065,487085,22882613,156839761,7368130225,50501915861,
%T 2372515049741,16261460067385,763942477886281,5236139639782013,
%U 245987105364332645,1686020702549740705,79207083984837225313,542893430081376724901,25504435056012222218045
%N Indices of heptagonal numbers (A000566) which are also triangular numbers (A000217).
%C From _Ant King_, Oct 19 2011: (Start)
%C lim_{n->infinity} a(2n+1)/a(2n) = (1/2)*(47+21*sqrt(5)).
%C lim_{n->infinity} a(2n)/a(2n-1) = (1/2)*(7+3*sqrt(5)).
%C (End)
%C From _Raphie Frank_, Nov 30 2012: (Start)
%C Where L_n is a Lucas number and F_n is Fibonacci number:
%C lim_{n->infinity} a(2n+1)/a(2n) = (1/2)*(L_8 + F_8*sqrt(5)),
%C lim_{n->infinity} a(2n)/a(2n-1) = (1/2)*(L_4 + F_4*sqrt(5)),
%C a(n) = L_1*a(n-1) + L_12*a(n-2) - L_12*a(n-3)- L_1*a(n-4) + L_1*a(n-5).
%C (End)
%C Values of n such that 2*n-1 and 10*n-1 are both perfect squares. - _Colin Barker_, Dec 03 2016
%H Colin Barker, <a href="/A046193/b046193.txt">Table of n, a(n) for n = 1..798</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HeptagonalTriangularNumber.html">Heptagonal Triangular Number.</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,322,-322,-1,1).
%F For n odd, a(n+2) = 322*a(n+1) - a(n) - 96; for n even, a(n+1) = 161*a(n) - 48 + 36*sqrt(20*a(n)^2 - 12*a(n)+1). - _Richard Choulet_, Sep 29 2007, Oct 09 2007
%F From _Ant King_, Oct 19 2011: (Start)
%F a(n) = 322*a(n-2) - a(n-4) - 96.
%F a(n) = a(n-1) + 322*a(n-2) - 322*a(n-3) - a(n-4) + a(n-5).
%F a(n) = (1/20)*((sqrt(5)-(-1)^n)*(sqrt(5)+2)^(2n-1) + (sqrt(5)+(-1)^n)*(sqrt(5)-2)^(2n-1)+6).
%F a(n) = ceiling((1/20)*(sqrt(5)-(-1)^n)*(2+sqrt(5))^(2n-1)).
%F G.f.: x*(1 + 4*x - 106*x^2 + 4*x^3 + x^4)/((1-x)*(1-18*x+x^2)*(1+18*x+x^2)).
%F (End)
%t LinearRecurrence[{1,322,-322,-1,1},{1,5,221,1513,71065},17] (* _Ant King_, Oct 19 2011 *)
%t Select[Range@240000000, IntegerQ@Sqrt[2 # - 1] && IntegerQ@Sqrt[10 # - 1] &] (* _Vincenzo Librandi_, Dec 04 2016 *)
%o (PARI) Vec(-x*(x^4+4*x^3-106*x^2+4*x+1)/((x-1)*(x^2-18*x+1)*(x^2+18*x+1)) + O(x^50)) \\ _Colin Barker_, Jun 23 2015
%o (Magma) [n: n in [1..2*10^8] |IsSquare(2*n-1) and IsSquare(10*n-1)]; // _Vincenzo Librandi_, Dec 04 2016
%Y Cf. A039835, A046194.
%K nonn,easy
%O 1,2
%A _Eric W. Weisstein_