OFFSET
1,1
COMMENTS
It is easy to prove that there are no numbers k such that k-1 is a triangular number and k+1 is a square.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,34,-34,-1,1).
FORMULA
G.f.: x*(2 + 3*x - 8*x^2 + 3*x^3 + 2*x^4)/((1 - x)*(1 - 6*x + x^2)*(1 + 6*x + x^2)).
a(n) = a(-n-1) = a(n-1) + 34*a(n-2) - 34*a(n-3) - a(n-4) + a(n-5).
a(n) = 35*a(n-2) - 35*a(n-4) + a(n-6) = 34*a(n-2) - a(n-4) + 2.
a(n) = (-2 + (13*sqrt(2) + 7*(-1)^n)*(1 + sqrt(2))^(2*n+1) - (13*sqrt(2) - 7* (-1)^n)*(1 - sqrt(2))^(2*n+1))/32.
a(n) = A214838(n) - 1.
a(n) = A077241(n-1)^2 + 1.
MATHEMATICA
LinearRecurrence[{1, 34, -34, -1, 1}, {2, 5, 65, 170, 2210}, 25]
PROG
(PARI) Vec(x*(2 + 3*x - 8*x^2 + 3*x^3 + 2*x^4)/((1 - x)*(1 - 6*x + x^2)*(1 + 6*x + x^2)) + O(x^30)) \\ Colin Barker, Jun 14 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Jun 11 2018
STATUS
approved