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