OFFSET
2,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 2..5002
FORMULA
a(n) = floor(p(n)/p(n-1)), where p(n) = n!/Product_{j=n-floor(2*n/3)..n-floor(n/3)} j.
From G. C. Greubel, Dec 05 2022: (Start)
a(n) = floor( n*Gamma(n - floor(2*n/3))*Gamma(n - floor((n-1)/3))/(Gamma(n - floor(n/3) + 1)*Gamma(n - floor(2*(n-1)/3) - 1)) ).
a(n) = n if n mod 3 = 0, 1 if n mod 3 = 2, otherwise floor((n-2)/2). (End)
MATHEMATICA
p[n_]= n!/Product[i, {i, n -Floor[2*n/3], n -Floor[n/3]}];
Table[Floor[p[n]/p[n-1]], {n, 2, 100}]
(* Second program *)
a[n_]:= If[Mod[n, 3]==0, n, If[Mod[n, 3]==2, 1, Floor[(n-2)/2]]];
Table[a[n], {n, 2, 100}] (* G. C. Greubel, Dec 05 2022 *)
PROG
(Magma)
function A088441(n)
if (n mod 3) eq 0 then return n;
elif (n mod 3) eq 2 then return 1;
else return Floor((n-2)/2);
end if; return A088441;
end function;
[A088441(n): n in [2..100]]; // G. C. Greubel, Dec 05 2022
(SageMath)
def A088441(n):
if (n%3)==0: return n
elif (n%3)==2: return 1
else: return (n-2)//2
[A088441(n) for n in range(2, 100)] # G. C. Greubel, Dec 05 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Nov 09 2003
EXTENSIONS
Edited by G. C. Greubel, Dec 05 2022
STATUS
approved