OFFSET
1,1
COMMENTS
For (n^2 + 1)*(k^2) + (n^2 +1)*k + 1 = j^2 there is a sequence k(i,n) with a recurrence.
For n=1, k(1,1) = 0, k(2,1) = 3, k(i,1) = 6*k(i-1,1) + 2 - k(i-2,1).
For n=2, k(1,2) = 1, k(2,2) = 19, k(i,2) = 18*k(i-1,2) + 8 - k(i-2,2).
For n>2, k(1,n) = 0, k(2,n) = n^2 - 2*n, k(3,n) = n^2 + 2*n, k(4,n) = (4*n^2 + 2)*k(2,n) + 2*n^2 then k(i,n) = (4*n^2 + 2)*k(i-2,n) + 2*n^2 - k(i-4,n). As i increases the ratio j(i,n)/k(i,n) tends to sqrt(n^2 + 1).
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
For n > 2, a(n) = n^2 - 2*n.
a(n) = A005563(n-2), n>2. - R. J. Mathar, Aug 28 2008
G.f.: (3 - x - 12*x^2 + 20*x^3 - 8*x^4)/(1 - x)^3. - G. C. Greubel, May 11 2017
MATHEMATICA
CoefficientList[Series[(-3 + z + 12*z^2 - 20*z^3 + 8*z^4)/(-1 + z)^3, {z, 0, 60}], z] (* Vladimir Joseph Stephan Orlovsky, Feb 17 2012 *)
LinearRecurrence[{3, -3, 1}, {3, 8, 3, 8, 15}, 60] (* Harvey P. Dale, Jul 05 2022 *)
PROG
(PARI) x='x+O('x^50); Vec((3-x-12*x^2+20*x^3-8*x^4)/(1-x)^3) \\ G. C. Greubel, May 11 2017
(PARI) a(n)=n*if(n>2, n-2, n+2) \\ Charles R Greathouse IV, Oct 19 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Pierre CAMI, Apr 26 2005
STATUS
approved