cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A123144 a(1) = 1, a(n) = a(n-1) if n = 1 (mod 3), otherwise n*a(n-1).

Original entry on oeis.org

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
Offset: 1

Views

Author

Roger L. Bagula, Oct 01 2006

Keywords

Comments

Without duplicates this sequence is A293653.

Crossrefs

Programs

  • 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
    
  • 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 *)
  • 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

Extensions

Edited by N. J. A. Sloane, Oct 04 2006