OFFSET
1,2
COMMENTS
The centered hexagonal numbers are given by 3*p^2 - 3*p + 1 while the centered triangular numbers are given by (3*r^2 + 3*r + 2)/2. A natural number is both of the above numbers if and only if there exist numbers p and r such that 2*(2p-1)^2 = (2*r+1)^2+1. The Diophantine equation X^2 = 2*Y^2 - 1 has the following solutions: X is given by 1, 7, 41, 239, ..., i.e., A002315, and Y is given by A001653. The first equation gives r with 0, 3, 20, 119, 6906, i.e., A001652, and p with 1, 3, 15, 85, 493, ..., i.e., A011900.
LINKS
Colin Barker, Table of n, a(n) for n = 1..654
Index entries for linear recurrences with constant coefficients, signature (35,-35,1).
FORMULA
a(n+2) = 34*a(n+1) - a(n) - 14.
a(n+1) = 17*a(n) - 7 + sqrt(288*a(n)^2 - 252*a(n) + 45).
G.f.: h(z)=(z*(1-16*z+z^2))/((1-z)*(1-34*z+z^2)).
a(n) = 35*a(n-1) - 35*a(n-2) + a(n-3). - Colin Barker, Jan 02 2015
a(n) = (14+(9+6*sqrt(2))*(17+12*sqrt(2))^(-n)+(9-6*sqrt(2))*(17+12*sqrt(2))^n)/32. - Colin Barker, Mar 02 2016
MATHEMATICA
a[n_] := 17*n - 7 + Sqrt[288*n^2 - 252*n + 45]; NestList[a, 1, 20] (* Stefan Steinerberger, Sep 18 2007 *)
LinearRecurrence[{35, -35, 1}, {1, 19, 631}, 30] (* Harvey P. Dale, Jan 16 2016 *)
PROG
(PARI) Vec(-x*(x^2-16*x+1)/((x-1)*(x^2-34*x+1)) + O(x^100)) \\ Colin Barker, Jan 02 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Richard Choulet, Sep 18 2007
EXTENSIONS
More terms from Stefan Steinerberger, Sep 18 2007
STATUS
approved