login
A088441
a(n) = n if n == 0 (mod 3), a(n) = 1 if n == 2 (mod 3), otherwise a(n) = floor((n-2)/2).
1
1, 3, 1, 1, 6, 2, 1, 9, 4, 1, 12, 5, 1, 15, 7, 1, 18, 8, 1, 21, 10, 1, 24, 11, 1, 27, 13, 1, 30, 14, 1, 33, 16, 1, 36, 17, 1, 39, 19, 1, 42, 20, 1, 45, 22, 1, 48, 23, 1, 51, 25, 1, 54, 26, 1, 57, 28, 1, 60, 29, 1, 63, 31, 1, 66, 32, 1, 69, 34, 1, 72, 35, 1, 75, 37, 1, 78, 38, 1, 81, 40, 1
OFFSET
2,2
LINKS
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
Sequence in context: A088439 A162315 A109446 * A061857 A275464 A067433
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Nov 09 2003
EXTENSIONS
Edited by G. C. Greubel, Dec 05 2022
STATUS
approved