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.

A226718 n! mod tetrahedral(n), that is A000142(n) mod A000292(n).

Original entry on oeis.org

0, 2, 6, 4, 15, 48, 0, 0, 45, 120, 66, 168, 0, 0, 120, 288, 153, 360, 0, 0, 231, 528, 0, 0, 0, 0, 378, 840, 435, 960, 0, 0, 0, 0, 630, 1368, 0, 0, 780, 1680, 861, 1848, 0, 0, 1035, 2208, 0, 0, 0, 0, 1326, 2808, 0, 0, 0, 0, 1653, 3480, 1770, 3720, 0, 0, 0, 0, 2145, 4488
Offset: 1

Views

Author

Alex Ratushnyak, Jun 15 2013

Keywords

Crossrefs

Programs

  • Maple
    A226718 := proc(n)
        n! mod ( n*(n+1)*(n+2)/6) ;
    end proc: # R. J. Mathar, Jun 18 2013
  • Mathematica
    Table[Mod[n!, n (n + 1) (n + 2)/6], {n, 66}] (* Ivan Neretin, May 18 2015 *)
  • Python
    f = 1
    for i in range(1, 100):
        f *= i
        print(f % (i*(i+1)*(i+2)//6), end=', ')

Formula

a(n) = n! mod (n*(n+1)*(n+2)/6).
For n>4: if neither n+1 nor n+2 is prime, then a(n)=0. Otherwise, a(n)=n(n+1)/2 for odd n and a(n)=n(n+2) for even n. - Ivan Neretin, May 18 2015