OFFSET
0,2
COMMENTS
Sequence found by reading the line from 0, in the direction 0, 9, 10, ... in the triangle spiral.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Hans G. Oberlack, Triangle spiral line 0-9-10
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
For even n: a(n) = n*((3/2)*n+2).
For odd n: a(n) = a(n+1)-1 = (n+1)*((3/2)*(n+1)+2)-1.
From Colin Barker, Dec 18 2018: (Start)
G.f.: x*(9 + x + 3*x^2 - x^3) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
(End)
MAPLE
a:= n-> `if`(n::even, n*((3/2)*n+2), (n+1)*((3/2)*(n+1)+2)-1): seq(a(n), n=0..50); # Muniru A Asiru, Dec 20 2018
PROG
(PARI) concat(0, Vec(x*(9 + x + 3*x^2 - x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40))) \\ Colin Barker, Dec 18 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hans G. Oberlack, Dec 09 2018
STATUS
approved