Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #50 Feb 14 2019 14:24:01
%S 0,1,12,13,36,37,72,73,120,121,180,181,252,253,336,337,432,433,540,
%T 541,660,661,792,793,936,937,1092,1093,1260,1261,1440,1441,1632,1633,
%U 1836,1837,2052,2053,2280,2281,2520,2521,2772,2773,3036,3037,3312,3313,3600
%N Numbers on the 0-1-12 line in a spiral on a grid of equilateral triangles.
%C Sequence found by reading the line from 0, in the direction 0, 1, 12, ... in the triangle spiral.
%H Colin Barker, <a href="/A322462/b322462.txt">Table of n, a(n) for n = 0..1000</a>
%H Hans G. Oberlack, <a href="/A322462/a322462.png">Triangle spiral line 0-1-12-13</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F a(n) = (3/2)*n*(n+2) = A049598(n/2) if n even, a(n) = a(n-1)+1 if n odd.
%F G.f.: -x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3). - _Alois P. Heinz_, Dec 09 2018
%F 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
%e a(0) = 0
%e a(1) = a(1 - 1) + 1 = 0 + 1
%e a(2) = (3/2) * 2 * (2 + 2) = 3 * 4 = 12
%e a(3) = a(3 - 1) + 1 = 12 + 1 = 13
%e a(4) = (3/2) * 4*(4 + 2) = 3 * 2 * 6 = 6 * 6 = 36
%e a(5) = a(4) + 1 = 36 + 1 = 37.
%p 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
%t 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 *)
%o (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
%Y Cf. A049598.
%K nonn,easy
%O 0,3
%A _Hans G. Oberlack_, Dec 09 2018
%E Examples added by _Hans G. Oberlack_, Dec 20 2018