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.

A158851 a(n) = lcm(1,2,3,...,n) mod (n+1).

Original entry on oeis.org

1, 2, 2, 2, 0, 4, 4, 3, 0, 1, 0, 4, 0, 0, 8, 5, 0, 14, 0, 0, 0, 15, 0, 5, 0, 18, 0, 1, 0, 20, 16, 0, 0, 0, 0, 2, 0, 0, 0, 15, 0, 15, 0, 0, 0, 8, 0, 21, 0, 0, 0, 29, 0, 0, 0, 0, 0, 21, 0, 16, 0, 0, 32, 0, 0, 29, 0, 0, 0, 23, 0, 22, 0, 0, 0, 0, 0, 30, 0, 54, 0, 71, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 7, 0
Offset: 1

Views

Author

Leroy Quet, Mar 28 2009

Keywords

Comments

If n+1 is not a power of a prime, then a(n) = 0.
If n+1 = p^m, p = prime, then p^(m-1) (= (n+1)/p) divides a(n), but p^m (= n+1) does not divide a(n).

Examples

			a(6) = lcm(1,2,3,4,5,6) mod (6+1) = 60 mod 7 = 4.
		

Crossrefs

Cf. A003418.

Programs

  • GAP
    List([1..100],n->Lcm([1..n]) mod (n+1)); # Muniru A Asiru, Mar 06 2018
    
  • Magma
    [Lcm([1..n]) mod (n+1): n in [1..100]]; // Vincenzo Librandi, Mar 07 2018
  • Maple
    a := proc (n) options operator, arrow: `mod`(lcm(seq(j, j = 1 .. n)), n+1) end proc: seq(a(n), n = 1 .. 100); # Emeric Deutsch, Apr 03 2009
  • Mathematica
    Array[Mod[LCM @@ Range@ #, # + 1] &, 97] (* Michael De Vlieger, Mar 04 2018 *)
  • PARI
    a(n) = lcm(vector(n, k, k)) % (n+1); \\ Michel Marcus, Mar 06 2018
    

Formula

a(2^n-1) = 2^(n-1). - Thomas Ordowski, Sep 18 2018

Extensions

More terms from Emeric Deutsch, Apr 03 2009