(MAGMAMagma) [n*(5*n^2-8*n+5)/2: n in [0..40]];
(MAGMAMagma) I:=[0, 1, 9, 39]; [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..45]]; // Vincenzo Librandi, Aug 18 2013
(MAGMAMagma) [n*(5*n^2-8*n+5)/2: n in [0..40]];
(MAGMAMagma) I:=[0, 1, 9, 39]; [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..45]]; // Vincenzo Librandi, Aug 18 2013
editing
approved
LinearRecurrence[{4, -6, 4, -1}, {0, 1, 9, 39}, 50] (* Harvey P. Dale, May 19 2017 *)
approved
editing
editing
approved
(PARI) a(n)=n*(5*n^2-8*n+5)/2 \\ Charles R Greathouse IV, Oct 07 2015
approved
editing
<a href="/index/Rec#order_04">Index to sequences with entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
editing
approved
a(n) = n*(5*n^2-8*n+5)/2.
approved
editing
editing
approved
A006003(n) = A000217(n) + n*A000217(n-1) (b = triangular numbernumbers);
A069778(n) = A000290(n+1) + (n+1)*A000290(n) (b = square numbernumbers);
A143690(n) = A000326(n+1) + (n+1)*A000326(n) (b = pentagonal numbernumbers);
A212133(n) = A000384(n) + n*A000384(n-1) (b = hexagonal numbernumbers);
a(n) = A000566(n) + n*A000566(n-1) (b = heptagonal numbernumbers);
A226450(n) = A000567(n) + n*A000567(n-1) (b = octagonal numbernumbers);
A226451(n) = A001106(n) + n*A001106(n-1) (b = nonagonal numbernumbers);
A204674(n) = A001107(n+1) + (n+1)*A001107(n) (b = decagonal numbernumbers).
approved
editing