OFFSET
0,4
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
MATHEMATICA
f[n_]:= (n+1)*f[n-3]; f[0]=1; f[1]=1; f[2]=1; Table[f[n], {n, 30}]
RecurrenceTable[{a[0]==a[1]==a[2]==1, a[n]==(n+1)a[n-3]}, a, {n, 30}] (* Harvey P. Dale, Mar 06 2019 *)
PROG
(PARI) a(n) = if(n<3, 1, (n+1)*a(n-3) );
vector(35, n, a(n-1)) \\ G. C. Greubel, Aug 24 2019
(Magma) a:= func< n | n le 2 select 1 else n in [3..5] select n+1 else (n+1)*Self(n-2) >;
[a(n): n in [0..35]]; // G. C. Greubel, Aug 24 2019
(Sage)
def a(n):
if n<3: return 1
elif 3<= n <= 5: return n+1
else: return (n+1)*a(n-3)
[a(n) for n in (0..35)] # G. C. Greubel, Aug 24 2019
(GAP)
a:= function(k)
if k<3 then return 1;
elif k<6 then return k+1;
else return (k+1)*a(k-3);
fi;
end;
List([0..35], n-> a(n) ); # G. C. Greubel, Aug 24 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Apr 01 2003
EXTENSIONS
Corrected and extended by Harvey P. Dale, Mar 06 2019
STATUS
approved