OFFSET
0,2
COMMENTS
Old name: Write 0,1,2,3,4,... in a triangular spiral, then a(n) is the sequence found by reading the line from 0 in the direction 0,8,...
Sequence found by reading the line from 0, in the direction 0, 25, ... and the line from 8, in the direction 8, 51, ..., in the square spiral whose vertices are the generalized 11-gonal numbers A195160. - Omar E. Pol, Jul 24 2012
LINKS
Ivan Panchenko, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = n*(9*n+7)/2.
a(n) = 9*n + a(n-1) - 1 (with a(0)=0). - Vincenzo Librandi, Aug 07 2010
From Bruno Berselli, Jan 13 2011: (Start)
G.f.: x*(8 + x)/(1 - x)^3.
a(n) = Sum_{i=0..n-1} A017257(i) for n > 0. (End)
a(n) = A218470(9n+7). - Philippe Deléham, Mar 27 2013
E.g.f.: x*(16 + 9*x)*exp(x)/2. - G. C. Greubel, May 24 2019
EXAMPLE
The spiral begins:
15
/ \
16 14
/ \
17 3 13
/ / \ \
18 4 2 12
/ / \ \
19 5 0---1 11
/ / \
20 6---7---8---9--10
MATHEMATICA
Table[n*(9*n+7)/2, {n, 0, 50}] (* G. C. Greubel, May 24 2019 *)
LinearRecurrence[{3, -3, 1}, {0, 8, 25}, 50] (* Harvey P. Dale, Sep 06 2019 *)
PROG
(PARI) a(n)=n*(9*n+7)/2 \\ Charles R Greathouse IV, Jun 17 2017
(Magma) [n*(9*n+7)/2: n in [0..50]]; // G. C. Greubel, May 24 2019
(Sage) [n*(9*n+7)/2 for n in (0..50)] # G. C. Greubel, May 24 2019
(GAP) List([0..50], n-> n*(9*n+7)/2) # G. C. Greubel, May 24 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Floor van Lamoen, Jul 21 2001
EXTENSIONS
New name from Bruno Berselli (with the original formula), Jan 13 2011
STATUS
approved