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.
%I A187824 #102 Sep 18 2020 16:38:51 %S A187824 3,4,5,6,3,4,4,5,3,6,4,4,3,5,5,4,3,6,5,5,3,4,6,6,3,4,4,7,3,6,4,4,3,7, %T A187824 7,4,3,5,5,8,3,4,5,5,3,4,4,8,3,5,4,4,3,9,5,4,3,6,6,6,3,4,5,6,3,4,4,5, %U A187824 3,10,4,4,3,5,5,4,3,6,5,5,3,4,7,7,3,4,4,6,3,7,4,4,3,6,6,4,3,5,5,6,3 %N A187824 a(n) is the largest m such that n is congruent to -1, 0 or 1 mod k for all k from 1 to m. %C A187824 This sequence and A187771 and A187761 are winners in the contest held at the 2013 AMS/MAA Joint Mathematics Meetings. - _T. D. Noe_, Jan 14 2013 %C A187824 If n = t!-1 then a(n) >= t, so sequence is unbounded. - _N. J. A. Sloane_, Dec 30 2012 %C A187824 First occurrence of k = 3, 4, 5, ...: 2, 3, 4, 5, 29, 41, 55, 71, 881, 791, 9360, 10009, 1079, 30239, (17 unknown), 246960, (19 unknown), 636481, 1360800, 3160079, (23 unknown), 2162161, 266615999, 39412801 (27 unknown), 107881201, ... Searched up to 3*10^9. - _Robert G. Wilson v_, Dec 31 2012 %H A187824 N. J. A. Sloane, <a href="/A187824/b187824.txt">Table of n, a(n) for n = 2..10000</a> %H A187824 Don Reble, <a href="/A187824/a187824.pdf">Division gets rough: OEIS A187824 and A220890</a> %F A187824 If n == 0 (mod 20), then a(n-2) = a(n+2) = 3, while a(n) = 5,5,6, 5,5,8, 5,5,6, 5,5,6, 5,5,7, 5,5,6, 5,5,7, ... with records a(20) = 5, a(60) = 6, a(120) = 8, a(720) = 10, a(2520) = 12, a(9360) = 13, ... If n == 0 (mod 5), but is not a multiple of 20, then always a(n-2) = a(n+2) = 4, while a(n) = 6,3,5, 6,3,7, 5,3,9, 6,3,5, 7,3,6, 5,3,6, 7,3,5, ... - _Vladimir Shevelev_, Dec 31 2012 %F A187824 a(n)=3 iff n == 2 (mod 4). a(n)=4 iff n == 3, 7, 8, 12, 13, 17 (mod 20), i.e., n == 2 or 3 (mod 5) but not n == 2 (mod 4). In the same way one can obtain a covering set for any value taken by a(n), this is actually nothing else than the definition. For example, n == 2, 3 or 4 (mod 6) but not 2 or 3 (mod 5) nor 2 (mod 4) yields a(n)=5 iff n == 4, 9, 15, 16, 20, 21, 39, 40, 44, 45, 51 or 56 (mod 60), etc. - _M. F. Hasler_, Dec 31 2012 %e A187824 For n = 6, a(6) = 3 as follows. %e A187824 m Residue of 6 (mod m) %e A187824 1 0 %e A187824 2 0 %e A187824 3 0 %e A187824 4 2 %e A187824 5 1 %e A187824 6 0 %e A187824 7 -1 %p A187824 A187824:= proc(n) %p A187824 local j,r; %p A187824 for j from 4 do %p A187824 r:= mods(n, j); %p A187824 if r <> r^3 then return j-1 end if %p A187824 end do %p A187824 end proc; # _Robert Israel_, Dec 31 2012 %t A187824 f[n_] := Block[{k = 4, r}, While[r = Mod[n, k]; r < 2 || k - r < 2, k++]; k - 1]; Array[f, 101, 2] (* _Robert G. Wilson v_, Dec 31 2012 *) %o A187824 (Small Basic) %o A187824 For n = 1 To 100 %o A187824 For m = 1 To 100 %o A187824 i = Math.Round(n/m) %o A187824 d = Math.Abs(n-i*m) %o A187824 If d > 1 Then %o A187824 a = m - 1 %o A187824 Goto OUT %o A187824 Else %o A187824 EndIf %o A187824 EndFor %o A187824 OUT: %o A187824 TextWindow.Write(n+" ") %o A187824 TextWindow.Write(a+" ") %o A187824 TextWindow.WriteLine(" ") %o A187824 EndFor %o A187824 (PARI) A187824(n)={n++>2 && for(k=4,oo, n%k>2 && return(k-1))} \\ _M. F. Hasler_, Dec 31 2012, minor edits Aug 20 2020 %o A187824 (PARI) a(n)=my(k=3);n++;while(n%k++<3,);k-1 \\ _Charles R Greathouse IV_, Jan 02 2013 %o A187824 (Python) %o A187824 from gmpy2 import t_mod %o A187824 def A187824(n): %o A187824 k = 1 %o A187824 while t_mod(n+1,k) < 3: %o A187824 k += 1 %o A187824 return k-1 # _Chai Wah Wu_, Aug 31 2014 %o A187824 (Python) %o A187824 def a(n): %o A187824 m=1 %o A187824 while abs(n%m) < 2: %o A187824 m += 1 %o A187824 return m %o A187824 [a(n) for n in range(1,100)] %o A187824 # _Derek Orr_, Aug 31 2014, corrected & edited by _M. F. Hasler_, Aug 20 2020 %Y A187824 For values of n which set a new record see A220891. %Y A187824 For smallest inverse see A220890 and A056697. %K A187824 nonn,nice %O A187824 2,1 %A A187824 _Kival Ngaokrajang_, Dec 27 2012 %E A187824 Corrected m = 100 by _Kival Ngaokrajang_, Dec 30 2012 %E A187824 Definition & example corrected by _Kival Ngaokrajang_, Dec 30 2012 %E A187824 More terms from _N. J. A. Sloane_, Dec 30 2012