%I #30 Sep 08 2024 17:32:28
%S 0,-1,2,15,44,95,174,287,440,639,890,1199,1572,2015,2534,3135,3824,
%T 4607,5490,6479,7580,8799,10142,11615,13224,14975,16874,18927,21140,
%U 23519,26070,28799,31712,34815,38114,41615,45324,49247,53390,57759,62360
%N a(n) = n^3 - n^2 - n.
%C For n > 1, these are also the largest positive integers k such that k + n divides k^3 + n^2. For all n > 1 and p > 1, the largest positive integer k such that k + n divides k^p + n^(p-1) is given by k = n^p - (-n)^(p-1) - n. Here, p = 3. - _Derek Orr_, Aug 13 2014
%H Derek Orr, <a href="/A152015/b152015.txt">Table of n, a(n) for n = 0..10000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F G.f.: -x*(1-6*x-x^2)/(1-x)^4. - _Bruno Berselli_, Jul 27 2012
%F a(n) = A002414(n) - A005449(n). - _Wesley Ivan Hurt_, Oct 06 2013
%F a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - _Wesley Ivan Hurt_, Aug 13 2014
%F E.g.f.: exp(x)*x*(x^2 + 2*x - 1). - _Stefano Spezia_, Apr 15 2022
%p a:=n->sum(-1+sum(1+sum(1,i=2..n),j=2..n),k=1..n): seq(a(n), n=0..44); # _Zerinvary Lajos_, Dec 22 2008
%p A152015:=n->n^3-n^2-n: seq(A152015(k), k=0..100); # _Wesley Ivan Hurt_, Oct 06 2013
%t lst={};Do[AppendTo[lst,n^3-n^2-n],{n,0,5!}];lst
%t Table[n^3-n^2-n, {n,0,100}] (* _Wesley Ivan Hurt_, Oct 06 2013 *)
%t LinearRecurrence[{4,-6,4,-1},{0,-1,2,15},50] (* _Harvey P. Dale_, Sep 08 2024 *)
%o (PARI) vector(100, n, (n-1)^3-(n-1)^2-(n-1)) \\ _Derek Orr_, Aug 13 2014
%o (Magma) [n^3-n^2-n : n in [0..50]]; // _Wesley Ivan Hurt_, Aug 13 2014
%Y Cf. A002414, A005449.
%K sign,easy
%O 0,3
%A _Vladimir Joseph Stephan Orlovsky_, Nov 20 2008
%E Offset changed by _Bruno Berselli_, Jul 27 2012