%I #47 Dec 12 2024 02:52:20
%S 0,-1,4,21,56,115,204,329,496,711,980,1309,1704,2171,2716,3345,4064,
%T 4879,5796,6821,7960,9219,10604,12121,13776,15575,17524,19629,21896,
%U 24331,26940,29729,32704,35871,39236,42805,46584,50579,54796,59241,63920,68839,74004,79421,85096,91035
%N a(n) = n^3 - 2*n.
%C For n > 0, a(n) is the largest number k such that k^3 + n is divisible by k + n, or -1 if k is infinite. The resulting integer is n^6 - 5n^4 + 7n^2 - 1.
%C For n > 1, a(n) is also the largest number k such that k + n^3 is divisible by k + n. - _Derek Orr_, Oct 16 2014
%C a(n)^2 has the form m^3 + 2*m^2, where m = n^2 - 2. - _Bruno Berselli_, May 03 2018
%H Jens Kruse Andersen, <a href="/A242135/b242135.txt">Table of n, a(n) for n = 0..10000</a>
%H Spencer Daugherty, Pamela E. Harris, Ian Klein, and Matt McClinton, <a href="https://arxiv.org/abs/2406.12941">Metered Parking Functions</a>, arXiv:2406.12941 [math.CO], 2024. See pp. 12, 22.
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F a(n) = A000578(n) - A005843(n). - _Wesley Ivan Hurt_, Aug 16 2014
%F G.f.: -x*(1-8*x+x^2)/(1-x)^4. - _Vincenzo Librandi_, Oct 17 2014
%F a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n > 3. - _Vincenzo Librandi_, Oct 17 2014
%F E.g.f.: exp(x)*x*(x^2 + 3*x - 1). - _Stefano Spezia_, Mar 04 2023
%e a(2) = 4. n = 2, k = 4. 4^3 + 2 = 66. k + n = 6 and 66 comes from the largest value of k such that k^3 + n is divisible by k + n. The resulting integer is 11 = n^6 - 5n^4 + 7n^2 - 1. - _Jon Perry_, Aug 16 2014
%p A242135:=n->n^3-2*n: seq(A242135(n), n=0..50); # _Wesley Ivan Hurt_, Aug 16 2014
%t Table[n^3 - 2 n, {n, 0, 50}] (* _Wesley Ivan Hurt_, Aug 16 2014 *)
%t CoefficientList[Series[- x (1 - 8 x + x^2)/(1 - x)^4, {x, 0, 50}], x] (* _Vincenzo Librandi_, Oct 17 2014 *)
%o (PARI) vector(100, n, (n-1)^3 - 2*(n-1))
%o (Magma) [n^3-2*n: n in [0..45]]; // _Vincenzo Librandi_, Oct 17 2014
%o (Magma) I:=[0,-1,4,21]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..50]]; // _Vincenzo Librandi_, Oct 17 2014
%Y Cf. A000578, A005843.
%K sign,easy
%O 0,3
%A _Derek Orr_, Aug 16 2014