OFFSET
1,2
COMMENTS
Equivalently, numbers of the form h*(9*h+4)-1, where h = 0, -1, 1, -2, 2, -3, 3, -4, 4, ...
Also, integer values of k*(k+4)/9 minus 1.
Is A063289 (after -1) the list of the square roots of 9*a(n)+13?
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: x*(-1 + 5*x + 10*x^2 + 5*x^3 - x^4)/((1 + x)^2*(1 - x)^3).
a(n) = a(-n+1) = (18*(n-1)*n + (2*n-1)*(-1)^n - 7)/8.
a(n) = A185039(n) + 1.
MATHEMATICA
Select[Range[-1, 6000], IntegerQ[Sqrt[9 # + 13]] &]
Table[(18 (n-1) n + (2 n - 1) (-1)^n - 7)/8, {n, 1, 50}]
LinearRecurrence[{1, 2, -2, -1, 1}, {-1, 4, 12, 27, 43}, 50] (* Harvey P. Dale, Jan 20 2020 *)
PROG
(Sage) [n for n in range(-1, 6000) if is_square(9*n+13)]
(Sage) [(18*(n-1)*n+(2*n-1)*(-1)^n-7)/8 for n in range(1, 50)]
(PARI) for(n=-1, 6000, if(issquare(9*n+13), print1(n, ", ")))
(PARI) vector(50, n, n; (18*(n-1)*n+(2*n-1)*(-1)^n-7)/8)
(Python) from gmpy2 import is_square
[n for n in range(-1, 6000) if is_square(9*n+13)]
(Python) [(18*(n-1)*n+(2*n-1)*(-1)**n-7)/8 for n in range(1, 60)]
(Magma) [n: n in [-1..6000] | IsSquare(9*n+13)];
(Magma) [(18*(n-1)*n+(2*n-1)*(-1)^n-7)/8: n in [1..50]];
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Bruno Berselli, Jan 07 2016
STATUS
approved