OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Milan Janjic, Two Enumerative Functions [broken link]
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = n*(9*n-5)/2.
a(n) = 9*n + a(n-1) - 7 (with a(0)=0). - Vincenzo Librandi, Aug 07 2010
From Colin Barker, Jul 07 2012: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: x*(2+7*x)/(1-x)^3. (End)
a(n) = A218470(9n+1). - Philippe Deléham, Mar 27 2013
E.g.f.: x*(4 + 9*x)*exp(x)/2. - G. C. Greubel, Sep 02 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
.
From Vincenzo Librandi, Aug 07 2010: (Start)
a(1) = 9*1 + 0 - 7 = 2;
a(2) = 9*2 + 2 - 7 = 13;
a(3) = 9*3 + 13 - 7 = 33. (End)
MAPLE
seq(n*(9*n-5)/2, n=0..50); # G. C. Greubel, Sep 02 2019
MATHEMATICA
Table[n*(9*n-5)/2, {n, 0, 50}] (* G. C. Greubel, Sep 02 2019 *)
nxt[{n_, a_}]:={n+1, 9(n+1)+a-7}; NestList[nxt, {0, 0}, 50][[All, 2]] (* Harvey P. Dale, Apr 11 2022 *)
PROG
(PARI) a(n)=n*(9*n-5)/2 \\ Charles R Greathouse IV, Jun 17 2017
(Magma) [n*(9*n-5)/2: n in [0..50]]; // G. C. Greubel, Sep 02 2019
(Sage) [n*(9*n-5)/2 for n in (0..50)] # G. C. Greubel, Sep 02 2019
(GAP) List([0..50], n-> n*(9*n-5)/2); # G. C. Greubel, Sep 02 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Floor van Lamoen, Jul 21 2001
STATUS
approved