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.

A123151 a(n) = A000124(n)*a(n-3) for n > 2, otherwise n!.

Original entry on oeis.org

1, 1, 2, 7, 11, 32, 154, 319, 1184, 7084, 17864, 79328, 559636, 1643488, 8408768, 67715956, 225157856, 1294950272, 11647144432, 43005150496, 273234507392, 2702137508224, 10923308225984, 75685958547584, 813343389975424, 3560998481670784, 26641457408749568
Offset: 0

Views

Author

Roger L. Bagula, Oct 01 2006

Keywords

Crossrefs

Programs

  • Magma
    function a(n) // a = A123151
      if n le 2 then return Factorial(n);
      else return (n^2+n+2)*a(n-3)/2;
      end if;
    end function;
    [a(n): n in [0..30]]; // G. C. Greubel, Jul 17 2023
    
  • Mathematica
    a[n_]:= a[n]= If[n<3, n!, (1/2)*(n^2+n+2)*a[n-3]];
    Table[a[n], {n,0,30}]
  • SageMath
    @CachedFunction # a = A123151
    def a(n): return factorial(n) if (n<3) else (n^2+n+2)*a(n-3)/2
    [a(n) for n in (0..30)] # G. C. Greubel, Jul 17 2023

Formula

a(n) = n! for n < 3, otherwise a(n) = A000124(n)*a(n-3), where A000124(n) = (n^2 + n + 2)/2.

Extensions

Edited by N. J. A. Sloane, Oct 04 2006
Edited by G. C. Greubel, Jul 17 2023