OFFSET
0,3
COMMENTS
Also, smallest k such that, for 0 <= i < n, i+1 divides k-i.
Suggested by Chinese Remainder Theorem. This sequence can generate others: smallest b(n) such that b(n) == i (mod (i+2)), 1 <= i <= n, gives b(1)=1 and b(n) = a(n+1)-1 for n > 1; smallest c(n) such that c(n) == i (mod (i+3)), 1 <= i <= n, gives c(1)=1, c(2)=17 and c(n) = a(n+2) - 2 for n > 2; smallest d(n) such that c(n) == i (mod (i+4)), 1 <= i <= n, gives d(1)=1, d(2)=26, d(3)=206 and d(n) = a(n+3) - 3 for n > 3, etc.
From Kival Ngaokrajang, Oct 10 2013: (Start)
Example for n = 3:
m\i = 1 2 3 sum
1 0 1 1 2
2 0 0 2 2
3 0 1 0 1
4 0 0 1 1
5 0 1 2 3 <--max remainder sum = 3 = A000217(2)
6 0 0 0 0 first occurs at m = 5 = A070198(2)
(End)
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
FORMULA
a(n) = lcm(1, 2, 3, ..., n+1) - 1 = A003418(n+1) - 1.
EXAMPLE
a(3) = 11 because 11 == 1 (mod 2), 11 == 2 (mod 3) and 11 == 3 (mod 4).
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 *)
PROG
(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 */
(Python)
from math import lcm
def A070198(n): return lcm(*range(1, n+2))-1 # Chai Wah Wu, May 02 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, May 06 2002
EXTENSIONS
Edited by N. J. A. Sloane, Nov 18 2007, at the suggestion of Max Alekseyev
STATUS
approved