%I #33 Sep 08 2022 08:45:38
%S 1,18,67,148,261,406,583,792,1033,1306,1611,1948,2317,2718,3151,3616,
%T 4113,4642,5203,5796,6421,7078,7767,8488,9241,10026,10843,11692,12573,
%U 13486,14431,15408,16417,17458,18531,19636,20773,21942,23143,24376
%N Ulam's spiral (WNW spoke).
%C Also sequence found by reading the segment (1, 18) together with the line from 18, in the direction 18, 67, ..., in the square spiral whose vertices are the generalized decagonal numbers A074377. - _Omar E. Pol_, Nov 05 2012
%H Harvey P. Dale, <a href="/A143859/b143859.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).
%F a(n) = 16*n^2 - 31*n + 16. - _R. J. Mathar_, Sep 08 2008
%F a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3), a(1)=1, a(2)=18, a(3)=67. - _Harvey P. Dale_, Mar 24 2012
%F G.f.: x*(1 + 15*x + 16*x^2)/(1-x)^3. - _Colin Barker_, Aug 03 2012
%F E.g.f.: -16 + (16 - 15*x + 16*x^2)*exp(x). - _G. C. Greubel_, Nov 09 2019
%p seq( ((32*n-31)^2+63)/64, n=1..50); # _G. C. Greubel_, Nov 09 2019
%t f[n_]:= 16n^2 -31n +16; Array[f, 40] (* _Vladimir Joseph Stephan Orlovsky_, Sep 03 2008 *)
%t LinearRecurrence[{3,-3,1},{1,18,67},40] (* _Harvey P. Dale_, Mar 24 2012 *)
%t CoefficientList[Series[(1+15x+16x^2)/(1-x)^3, {x,0,40}], x] (* _Vincenzo Librandi_, Nov 08 2014 *)
%o (Magma) [16*n^2-31*n+16: n in [1..50]]; // _Vincenzo Librandi_, Nov 08 2014
%o (PARI) vector(50, n, 16*n^2-31*n+16) \\ _Michel Marcus_, Nov 08 2014
%o (Sage) [((32*n-31)^2+63)/64 for n in (1..50)] # _G. C. Greubel_, Nov 09 2019
%o (GAP) List([1..50], n-> ((32*n-31)^2+63)/64); # _G. C. Greubel_, Nov 09 2019
%K nonn,easy
%O 1,2
%A _Vladimir Joseph Stephan Orlovsky_, Sep 03 2008