%I #164 Jun 11 2023 12:10:39
%S 0,2,21,95,816,3626,31005,137711,1177392,5229410,44709909,198579887,
%T 1697799168,7540806314,64471658493,286352060063,2448225223584,
%U 10873837476098,92968086837717,412919472031679,3530339074609680,15680066099727722,134059916748330141
%N Numbers k such that the k-th centered pentagonal number A005891(k) = (5k^2 + 5k + 2)/2 is a square.
%C Corresponding numbers m > 0 such that m^2 is a centered pentagonal number are listed in A129557 = {1, 4, 34, 151, 1291, 5734, 49024, ...}.
%C From _Andrea Pinos_, Nov 02 2022: (Start)
%C By definition: 5*T(a(n)) = A129557(n)^2 - 1 where triangular number T(j) = j*(j+1)/2. This implies:
%C Every odd prime factor of a(n) and d(n)=a(n)+1 is present in b(n)=A129557(n)+1 or in c(n)=A129557(n)-1. (End)
%C From the law of cosines the non-Pythagorean triple {a(n), a(n)+1=A254332(n), A129557(n+1)} forms a near-isosceles triangle whose angle between the consecutive integer sides is equal to the central angle of the regular pentachoron polytope (4-simplex) (see A140244 and A140245). This implies that the terms {a(n)} are also those numbers k such that 1 + 5*A000217(k) is a square. - _Federico Provvedi_, Apr 04 2023
%H Harvey P. Dale, <a href="/A129556/b129556.txt">Table of n, a(n) for n = 1..1000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CenteredPentagonalNumber.html">Centered Pentagonal Number</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,38,-38,-1,1).
%F For n >= 5, a(n) = 38*a(n-2) - a(n-4) + 18. - _Max Alekseyev_, May 08 2009
%F G.f.: x^2*(x^3+2*x^2-19*x-2) / ((x-1)*(x^2-6*x-1)*(x^2+6*x-1)). - _Colin Barker_, Feb 21 2013
%F a(n) = (A221874(n) - 1) / 2. - _Bruno Berselli_, Feb 21 2013
%F From _Andrea Pinos_, Oct 24 2022: (Start)
%F The ratios of successive terms converge to two different limits:
%F lower: D = lim_{n->oo} a(2n)/a(2n-1) = (7+2*sqrt(10))/3;
%F upper: E = lim_{n->oo} a(2n+1)/a(2n) = (13+4*sqrt(10))/3.
%F So lim_{n->oo} a(n+2)/a(n) = D*E = 19 + 6*sqrt(10). (End)
%F a(n) = (x^(2*(n+1)) + (-1)^n*(x^(2*n+1)+1) - x) / (2*x^n*(x^2 + 1)) - (1/2), with x=3+sqrt(10). - _Federico Provvedi_, Apr 04 2023
%p A005891 := proc(n) (5*n^2+5*n+2)/2 ; end: n := 0 : while true do if issqr(A005891(n)) then print(n) ; fi ; n := n+1 ; od : # _R. J. Mathar_, Jun 06 2007
%t Do[ f=(5n^2+5n+2)/2; If[ IntegerQ[ Sqrt[f] ], Print[n] ], {n,1,40000} ]
%t LinearRecurrence[{1,38,-38,-1,1},{0,2,21,95,816},30] (* _Harvey P. Dale_, Nov 09 2017 *)
%t Table[(((x^(n+2))+(((-1)^n*(x^(2*n+1)+1)-x)/(x^n)))/(x^2+1)-1)/2/.x->3+Sqrt[10],{n,0,50}]//Round (* _Federico Provvedi_, Apr 04 2023 *)
%o (PARI) a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; 1,-1,-38,38,1]^(n-1)*[0;2;21;95;816])[1,1] \\ _Charles R Greathouse IV_, Feb 11 2019
%Y Cf. A005891 (centered pentagonal numbers), A129557 (numbers k>0 such that k^2 is a centered pentagonal number), A221874.
%Y Cf. numbers m such that k*A000217(m)+1 is a square: A006451 for k=1; m=0 for k=2; A233450 for k=3; A001652 for k=4; this sequence for k=5; A001921 for k=6. - _Bruno Berselli_, Dec 16 2013
%K nonn,easy
%O 1,2
%A _Alexander Adamchuk_, Apr 20 2007
%E More terms from _R. J. Mathar_, Jun 06 2007
%E Further terms from _Max Alekseyev_, May 08 2009
%E a(22)-a(23) from _Colin Barker_, Feb 21 2013