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 A357866 #10 Oct 21 2022 06:59:29 %S A357866 0,0,1,0,2,0,3,2,4,2,5,2,6,4,7,4,8,4,9,6,10,6,11,6,12,8,13,8,14,8,15, %T A357866 10,16,10,17,10,18,12,19,12,20,12,21,14,22,14,23,14,24,16,25,16,26,16, %U A357866 27,18,28,18,29,18,30,20,31,20,32,20,33,22,34,22,35 %N A357866 a(n) is the greatest remainder of n divided by its sum of digits in any base > 1. %e A357866 For n = 11, we have: %e A357866 b sum of digits remainder %e A357866 ---- ------------- --------- %e A357866 2 3 2 %e A357866 3 3 2 %e A357866 4 5 1 %e A357866 5 3 2 %e A357866 6 6 5 %e A357866 7 5 1 %e A357866 8 4 3 %e A357866 9 3 2 %e A357866 10 2 1 %e A357866 11 1 0 %e A357866 >=12 11 0 %e A357866 so a(11) = 5. %o A357866 (PARI) a(n) = { my (mx=0); for (b=2, n, mx=max(mx, n%sumdigits(n, b))); return (mx); } %o A357866 (Python) %o A357866 from sympy.ntheory import digits %o A357866 def a(n): return max((n%sum(digits(n, b)[1:]) for b in range(2, n+1)), default=0) %o A357866 print([a(n) for n in range(1, 72)]) # _Michael S. Branicky_, Oct 17 2022 %Y A357866 Cf. A138530, A357823. %K A357866 nonn,base %O A357866 1,5 %A A357866 _Rémy Sigrist_, Oct 17 2022