login
a(n) = 0 for n <= 2; for n >= 3, a(n) = (n-2)*floor((n^2-2)/(n-2)).
4

%I #29 Apr 08 2023 04:43:15

%S 0,0,7,14,21,32,45,60,77,96,117,140,165,192,221,252,285,320,357,396,

%T 437,480,525,572,621,672,725,780,837,896,957,1020,1085,1152,1221,1292,

%U 1365,1440,1517,1596,1677,1760,1845,1932,2021,2112,2205,2300,2397,2496,2597,2700

%N a(n) = 0 for n <= 2; for n >= 3, a(n) = (n-2)*floor((n^2-2)/(n-2)).

%H Vincenzo Librandi, <a href="/A100451/b100451.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).

%F a(n) = (n-2)*(n+2), n >= 5. - _R. J. Mathar_, Aug 17 2009

%F a(n) = A028347(n), n >= 5. - _R. J. Mathar_, Jul 31 2010

%t Join[{0,0,7,14},Table[(n-2)(n+2),{n,5,60}]] (* or *) Join[{0,0,7,14}, LinearRecurrence[{3,-3,1},{21,32,45},60]] (* _Harvey P. Dale_, Oct 03 2011 *)

%o (Magma) [0,0],[(n-2)*Floor((n^2-2)/(n-2)): n in [3..30]]; // _Vincenzo Librandi_, Oct 04 2011

%o (PARI) a(n)=if(n<3,0,(n^2-2)\(n-2)*(n-2)) \\ _Charles R Greathouse IV_, Oct 16 2015

%o (SageMath)

%o def A100451(n):

%o return 7 * (n - 2) * ((n - 1) // 2) if n < 5 else (n - 2) * (n + 2)

%o print([A100451(n) for n in range(1, 61)]) # _G. C. Greubel_, Apr 07 2023

%Y Third row of array in A100452.

%Y Cf. A028347.

%K nonn,easy

%O 1,3

%A _N. J. A. Sloane_, Nov 22 2004

%E Factor in definition corrected by _R. J. Mathar_, Aug 17 2009