OFFSET
1,2
COMMENTS
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Nonagonal Square Number
Index entries for linear recurrences with constant coefficients, signature (1,30,-30,-1,1).
FORMULA
From Ant King, Nov 18 2011: (Start)
a(n) = 30 * a(n - 2) - a(n-4) - 10.
a(n) = a(n - 1) + 30 * a(n - 2) - 30 * a(n - 3) - a(n - 4) + a(n - 5).
Let p = 9 + 4 * sqrt(2) + sqrt(7) + 2 * sqrt(14) and q = 9 - 4 * sqrt(2) - sqrt(7) + 2 * sqrt(14). Then
a(n) = 1/56 * ( ( p - q * (-1) ^ n) * ( 2 * sqrt(2) + sqrt(7))^(n - 1) + ( p + q * (-1)^n) * ( 2 * sqrt(2) - sqrt(7))^n + 20 ).
a(n) = ceiling (1/56 * ( p - q * (-1) ^ n) * ( 2 * sqrt(2) + sqrt(7))^(n - 1) ).
G.f.: x * (1 + x - 14 * x^2 + x^3 + x^4) / ((1 - x) * (1 - 30 * x^2 + x^4)).
(End)
MATHEMATICA
LinearRecurrence[ {1, 30, - 30, -1, 1 }, {1, 2, 18, 49, 529}, 21 ] (* Ant King, Nov 18 2011 *)
PROG
(PARI) Vec(-x*(x^4+x^3-14*x^2+x+1)/((x-1)*(x^4-30*x^2+1)) + O(x^50)) \\ Colin Barker, Jun 22 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved