%I #90 Aug 29 2024 11:27:59
%S 0,3,7,16,24,39,51,72,88,115,135,168,192,231,259,304,336,387,423,480,
%T 520,583,627,696,744,819,871,952,1008,1095,1155,1248,1312,1411,1479,
%U 1584,1656,1767,1843,1960,2040,2163,2247,2376,2464,2599,2691
%N Numbers k such that 5*k + 1 is a square.
%C Third differences are 4, -6, 8, -10, 12, -14, 16, -18, 20, -22, 24, -26, 28, ...
%C X values of solutions to the equation 5*X^3 + X^2 = Y^2. - _Mohamed Bouhamida_, Nov 06 2007
%C Also, numbers 5*i^2 + 2*i for integer i. The characteristic function is A205633(n). - _Jason Kimberley_, Nov 15 2012
%C From _Gary W. Adamson_, Sep 22 2019: (Start)
%C Match the values a(n) with the squares 5k + 1 as follows:
%C 3,....7,....16,....24,... .a, a, a, a,...
%C 16,...36,....81,...121,... (base).
%C Then 1/5 in the matching base is equal to .a, a, a,...
%C Example: 1/5 in base 36 is equal to .7, 7, 7, 7...
%C Check: 7/36 + 7/36^2 = 259/1296 = .199845...; close to 1/5.
%C (End)
%H Jason Kimberley, <a href="/A036666/b036666.txt">Table of n, a(n) for n = 1..2000</a>
%H S. Cooper and M. D. Hirschhorn, <a href="http://dx.doi.org/10.1016/S0012-365X(03)00079-7">Results of Hurwitz type for three squares.</a> Discrete Math., Vol. 274, No. 1-3 (2004), pp. 9-24. See D(q).
%H Ralf Stephan, <a href="http://www.ark.in-berlin.de/A001082.ps">On the solutions to 'px+1 is square'</a>.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F G.f.: x*(3 + 4*x + 3*x^2) / ((1 - x)*(1 - x^2)).
%F a(n) has the form ((5*m + 1)^2 - 1)/5 if n is odd; a(n) has the form ((5*m + 4)^2 - 1)/5 if n is even.
%F a(2*k) = k*(5*k + 2), a(2*k + 1) = 5*k^2 + 8*k + 3. - _Mohamed Bouhamida_, Nov 06 2007
%F a(n+1) = n^2 + n + ceiling(n/2)^2. - _Gary Detlefs_, Feb 23 2010
%F From _Bruno Berselli_, Nov 27 2010: (Start)
%F a(n) = (10*n*(n - 1)+(2*n - 1)*(-1)^n + 1)/8.
%F 5*a(n) + 1 = A047209(n)^2. (End)
%F a(n) = Sum_{k=0..n} k + A109043(k). - _Jon Maiga_, Nov 28 2018
%F E.g.f.: (exp(x)*(1 + 10*x^2) - exp(-x)*(1 + 2*x))/8. - _Franck Maminirina Ramaharo_, Nov 29 2018
%F From _Amiram Eldar_, Mar 15 2022: (Start)
%F Sum_{n>=2} 1/a(n) = 5/4 - sqrt(1-2/sqrt(5))*Pi/2.
%F Sum_{n>=2} (-1)^n/a(n) = 5*(log(5)-1)/4 - sqrt(5)*log(phi)/2, where phi is the golden ratio (A001622). (End)
%p seq(n^2+n+ceil(n/2)^2, n=0..46); # _Gary Detlefs_, Feb 23 2010
%t (Select[ Range[121], Mod[ #, 5] == 1 || Mod[ #, 5] == 4 &]^2 - 1)/5 (* _Robert G. Wilson v_, Jun 23 2004 *)
%t Flatten[Position[5*Range[0,3000]+1,_?(IntegerQ[Sqrt[#]]&)]]-1 (* or *) LinearRecurrence[{1,2,-2,-1,1},{0,3,7,16,24},50] (* _Harvey P. Dale_, Feb 13 2018 *)
%t Accumulate[Table[n + LCM[n, 2], {n, 0, 121}]] (* _Jon Maiga_, Nov 28 2018 *)
%o (PARI) a(n)=n^2+n+ceil(n/2)^2
%o (Magma) [(n-1)^2+(n-1)+Ceiling((n-1)/2)^2 : n in [1..50]]; // _Wesley Ivan Hurt_, Jun 05 2014
%o (GAP) List([1..50],n->(10*n*(n-1)+(2*n-1)*(-1)^n+1)/8); # _Muniru A Asiru_, Nov 28 2018
%Y Cf. A001082, A001622, A002378, A005563, A046092, A047209, A109043, A205633.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_, Dec 11 1999
%E Better description and additional formula from _Santi Spadaro_, Jul 12 2001