A070198 Smallest nonnegative number m such that m == i (mod i+1) for all 1 <= i <= n.
0, 1, 5, 11, 59, 59, 419, 839, 2519, 2519, 27719, 27719, 360359, 360359, 360359, 720719, 12252239, 12252239, 232792559, 232792559, 232792559, 232792559, 5354228879, 5354228879, 26771144399, 26771144399, 80313433199, 80313433199
Offset: 0
Examples
a(3) = 11 because 11 == 1 (mod 2), 11 == 2 (mod 3) and 11 == 3 (mod 4).
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
- Eric Weisstein's World of Mathematics, Chinese Remainder Theorem
- Wikipedia, Chinese remainder theorem
- Index entries for sequences related to lcm's
Crossrefs
Cf. A057825 (indices of primes). - R. J. Mathar, Jan 14 2009
Cf. A116151. - Zak Seidov, Mar 11 2014
Programs
-
Haskell
a070198 n = a070198_list !! n a070198_list = map (subtract 1) $ scanl lcm 1 [2..] -- Reinhard Zumkeller, Mar 01 2012
-
Magma
[Exponent(SymmetricGroup(n))-1 : n in [1..30]]; /* Vincenzo Librandi, Oct 31 2014 - after Arkadiusz Wesolowski in A003418 */
-
Maple
seq(ilcm($1..n) - 1, n=1..100); # Robert Israel, Nov 03 2014
-
Mathematica
f[n_] := ChineseRemainder[ Range[0, n - 1], Range[n]]; Array[f, 28] (* or *) f[n_] := LCM @@ Range@ n - 1; Array[f, 28] (* Robert G. Wilson v, Oct 30 2014 *)
-
Python
from math import lcm def A070198(n): return lcm(*range(1,n+2))-1 # Chai Wah Wu, May 02 2023
Formula
a(n) = lcm(1, 2, 3, ..., n+1) - 1 = A003418(n+1) - 1.
Extensions
Edited by N. J. A. Sloane, Nov 18 2007, at the suggestion of Max Alekseyev
Comments