OFFSET
0,3
COMMENTS
Sequence found by reading the line from 0, in the direction 0, 1, 12, ... in the triangle spiral.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Hans G. Oberlack, Triangle spiral line 0-1-12-13
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = (3/2)*n*(n+2) = A049598(n/2) if n even, a(n) = a(n-1)+1 if n odd.
G.f.: -x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Dec 09 2018
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4. - Colin Barker, Dec 09 2018
EXAMPLE
a(0) = 0
a(1) = a(1 - 1) + 1 = 0 + 1
a(2) = (3/2) * 2 * (2 + 2) = 3 * 4 = 12
a(3) = a(3 - 1) + 1 = 12 + 1 = 13
a(4) = (3/2) * 4*(4 + 2) = 3 * 2 * 6 = 6 * 6 = 36
a(5) = a(4) + 1 = 36 + 1 = 37.
MAPLE
seq(coeff(series(-x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3), x, n+1), x, n), n = 0 .. 50); # Muniru A Asiru, Dec 19 2018
MATHEMATICA
a[0] = 0; a[n_] := a[n] = If[OddQ[n], a[n - 1] + 1, 3/2*n*(n + 2)]; Array[a, 50, 0] (* Amiram Eldar, Dec 09 2018 *)
PROG
(PARI) concat(0, Vec(x*(1 + 11*x - x^2 + x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40))) \\ Colin Barker, Dec 09 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hans G. Oberlack, Dec 09 2018
EXTENSIONS
Examples added by Hans G. Oberlack, Dec 20 2018
STATUS
approved