PROG
(MAGMAMagma) [n eq 0 select 1 else 41*n^2+2: n in [0..39]];
(MAGMAMagma) I:=[1, 43, 166, 371]; [n le 4 select I[n] else 3*Self(n-1)-3*Self(n-2)+Self(n-3): n in [1..41]]; // Vincenzo Librandi, Aug 18 2013
(MAGMAMagma) [n eq 0 select 1 else 41*n^2+2: n in [0..39]];
(MAGMAMagma) I:=[1, 43, 166, 371]; [n le 4 select I[n] else 3*Self(n-1)-3*Self(n-2)+Self(n-3): n in [1..41]]; // Vincenzo Librandi, Aug 18 2013
reviewed
approved
proposed
reviewed
editing
proposed
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n >= 4. - Wesley Ivan Hurt, Dec 18 2020
approved
editing
editing
approved
GO.g.f.: (1 + x)*(1 + 39*x + x^2)/(1 - x)^3.
approved
editing
editing
approved
(PARI) a(n)=if(n, 41*n^2+2, 1) \\ Charles R Greathouse IV, Sep 24 2015
approved
editing
editing
approved