OFFSET
1,1
COMMENTS
Sequence found by reading the line from 9, in the direction 9, 39, ..., in the square spiral whose vertices are the generalized heptagonal numbers A085787. - Omar E. Pol, Jul 18 2012
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Vincenzo Librandi, X^2-AY^2=1.
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f: x*(9 + 12*x - x^2)/(1 - x)^3.
a(n) = A033583(n) - 1. - Omar E. Pol, Jul 18 2012
From Amiram Eldar, Feb 04 2021: (Start)
Sum_{n>=1} 1/a(n) = (1 - (Pi/sqrt(10))*cot(Pi/sqrt(10)))/2.
Sum_{n>=1} (-1)^(n+1)/a(n) = ((Pi/sqrt(10))*csc(Pi/sqrt(10)) - 1)/2.
Product_{n>=1} (1 + 1/a(n)) = (Pi/sqrt(10))*csc(Pi/sqrt(10)).
Product_{n>=1} (1 - 1/a(n)) = csc(Pi/sqrt(10))*sin(Pi/sqrt(5))/sqrt(2). (End)
E.g.f.: exp(x)*(10*x^2 + 10*x - 1) + 1. - Stefano Spezia, Aug 25 2022
MAPLE
MATHEMATICA
Table[10n^2-1, {n, 50}]
LinearRecurrence[{3, -3, 1}, {9, 39, 89}, 50] (* Harvey P. Dale, Dec 08 2017 *)
PROG
(Magma) I:=[9, 39, 89]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+Self(n-3): n in [1..50]];
(PARI) a(n) = 10*n^2 - 1.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Mar 19 2009
STATUS
approved