login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A123144 a(1) = 1, a(n) = a(n-1) if n = 1 (mod 3), otherwise n*a(n-1). 2
1, 2, 6, 6, 30, 180, 180, 1440, 12960, 12960, 142560, 1710720, 1710720, 23950080, 359251200, 359251200, 6107270400, 109930867200, 109930867200, 2198617344000, 46170964224000, 46170964224000, 1061932177152000, 25486372251648000, 25486372251648000 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Without duplicates this sequence is A293653.
LINKS
MAPLE
a:= proc(n) option remember; `if`(n=0, 1,
`if`(irem(n, 3)=1, 1, n)*a(n-1))
end:
seq(a(n), n=1..32); # Alois P. Heinz, Jul 16 2023
MATHEMATICA
a[n_]:= a[n]= If[n==1, 1, If[Mod[n, 3]==1, a[n-1], n*a[n-1]]];
Table[a[n], {n, 30}]
nxt[{n_, a_}]:={n+1, If[Mod[n+1, 3]==1, a, a(n+1)]}; Transpose[NestList[nxt, {1, 1}, 20]][[2]] (* Harvey P. Dale, Jul 22 2014 *)
PROG
(Magma)
function a(n)
if n eq 1 then return 1;
elif (n mod 3) eq 1 then return a(n-1);
else return n*a(n-1);
end if;
end function;
[a(n): n in [1..40]]; // G. C. Greubel, Jul 16 2023
(SageMath)
def a(n): # A123144
if (n==1): return 1
elif (n%3==1): return a(n-1)
else: return n*a(n-1)
[a(n) for n in range(1, 41)] # G. C. Greubel, Jul 16 2023
CROSSREFS
Sequence in context: A093364 A113461 A061558 * A179215 A069260 A056603
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Oct 01 2006
EXTENSIONS
Edited by N. J. A. Sloane, Oct 04 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)