OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(n) = (n-2)*(n+2), n >= 5. - R. J. Mathar, Aug 17 2009
a(n) = A028347(n), n >= 5. - R. J. Mathar, Jul 31 2010
MATHEMATICA
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 *)
PROG
(Magma) [0, 0] cat [(n-2)*Floor((n^2-2)/(n-2)): n in [3..30]]; // Vincenzo Librandi, Oct 04 2011
(PARI) a(n)=if(n<3, 0, (n^2-2)\(n-2)*(n-2)) \\ Charles R Greathouse IV, Oct 16 2015
(SageMath)
def A100451(n):
return 7 * (n - 2) * ((n - 1) // 2) if n < 5 else (n - 2) * (n + 2)
print([A100451(n) for n in range(1, 61)]) # G. C. Greubel, Apr 07 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 22 2004
EXTENSIONS
Factor in definition corrected by R. J. Mathar, Aug 17 2009
STATUS
approved